diff --git a/.github/workflows/external_trigger.yml b/.github/workflows/external_trigger.yml index fdf0325..0f6f309 100755 --- a/.github/workflows/external_trigger.yml +++ b/.github/workflows/external_trigger.yml @@ -26,8 +26,8 @@ jobs: echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY echo "> External trigger running off of master branch. To disable this trigger, add \`duplicati_master\` into the Github organizational variable \`SKIP_EXTERNAL_TRIGGER\`." >> $GITHUB_STEP_SUMMARY printf "\n## Retrieving external version\n\n" >> $GITHUB_STEP_SUMMARY - EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/duplicati/duplicati/releases" | jq -r '. | first(.[] | select(.tag_name | contains("beta"))) | .tag_name') - echo "Type is \`custom_json\`" >> $GITHUB_STEP_SUMMARY + EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/duplicati/duplicati/releases/latest" | jq -r '. | .tag_name') + echo "Type is \`github_stable\`" >> $GITHUB_STEP_SUMMARY if grep -q "^duplicati_master_${EXT_RELEASE}" <<< "${SKIP_EXTERNAL_TRIGGER}"; then echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY echo "> Github organizational variable \`SKIP_EXTERNAL_TRIGGER\` matches current external release; skipping trigger." >> $GITHUB_STEP_SUMMARY diff --git a/Dockerfile b/Dockerfile index fcb1e91..eda863d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,8 +30,8 @@ RUN \ xz-utils && \ echo "**** install duplicati ****" && \ if [ -z ${DUPLICATI_RELEASE+x} ]; then \ - DUPLICATI_RELEASE=$(curl -sX GET "https://api.github.com/repos/duplicati/duplicati/releases" \ - | jq -r 'first(.[] | select(.tag_name | contains("beta"))) | .tag_name'); \ + DUPLICATI_RELEASE=$(curl -sX GET "https://api.github.com/repos/duplicati/duplicati/releases/latest" \ + | jq -r .tag_name); \ fi && \ duplicati_url=$(curl -s "https://api.github.com/repos/duplicati/duplicati/releases/tags/${DUPLICATI_RELEASE}" | jq -r '.assets[].browser_download_url' |grep 'linux-x64-gui.zip$') && \ curl -o \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 37054e5..1742e6d 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -30,8 +30,8 @@ RUN \ xz-utils && \ echo "**** install duplicati ****" && \ if [ -z ${DUPLICATI_RELEASE+x} ]; then \ - DUPLICATI_RELEASE=$(curl -sX GET "https://api.github.com/repos/duplicati/duplicati/releases" \ - | jq -r 'first(.[] | select(.tag_name | contains("beta"))) | .tag_name'); \ + DUPLICATI_RELEASE=$(curl -sX GET "https://api.github.com/repos/duplicati/duplicati/releases/latest" \ + | jq -r .tag_name); \ fi && \ duplicati_url=$(curl -s "https://api.github.com/repos/duplicati/duplicati/releases/tags/${DUPLICATI_RELEASE}" | jq -r '.assets[].browser_download_url' |grep 'linux-arm64-gui.zip$') && \ curl -o \ diff --git a/Jenkinsfile b/Jenkinsfile index ab107cc..5ed69ec 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,8 +19,9 @@ pipeline { DOCKERHUB_TOKEN=credentials('docker-hub-ci-pat') QUAYIO_API_TOKEN=credentials('quayio-repo-api-token') GIT_SIGNING_KEY=credentials('484fbca6-9a4f-455e-b9e3-97ac98785f5f') - JSON_URL = 'https://api.github.com/repos/duplicati/duplicati/releases' - JSON_PATH = 'first(.[] | select(.tag_name | contains("beta"))) | .tag_name' + EXT_GIT_BRANCH = 'master' + EXT_USER = 'duplicati' + EXT_REPO = 'duplicati' BUILD_VERSION_ARG = 'DUPLICATI_RELEASE' LS_USER = 'linuxserver' LS_REPO = 'docker-duplicati' @@ -138,14 +139,21 @@ pipeline { /* ######################## External Release Tagging ######################## */ - // If this is a custom json endpoint parse the return to get external tag - stage("Set ENV custom_json"){ + // If this is a stable github release use the latest endpoint from github to determine the ext tag + stage("Set ENV github_stable"){ steps{ script{ env.EXT_RELEASE = sh( - script: '''curl -s ${JSON_URL} | jq -r ". | ${JSON_PATH}" ''', + script: '''curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''', returnStdout: true).trim() - env.RELEASE_LINK = env.JSON_URL + } + } + } + // If this is a stable or devel github release generate the link for the build message + stage("Set ENV github_link"){ + steps{ + script{ + env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/releases/tag/' + env.EXT_RELEASE } } } @@ -982,7 +990,7 @@ pipeline { "tagger": {"name": "LinuxServer-CI","email": "ci@linuxserver.io","date": "'${GITHUB_DATE}'"}}' ''' echo "Pushing New release for Tag" sh '''#! /bin/bash - echo "Data change at JSON endpoint ${JSON_URL}" > releasebody.json + curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json echo '{"tag_name":"'${META_TAG}'",\ "target_commitish": "master",\ "name": "'${META_TAG}'",\ diff --git a/README.md b/README.md index 850cbfc..33fd2ff 100644 --- a/README.md +++ b/README.md @@ -63,8 +63,8 @@ This image provides various versions that are available via tags. Please read th | Tag | Available | Description | | :----: | :----: |--- | -| latest | ✅ | Beta releases of Duplicati | -| development | ✅ | Canary releases of Duplicati | +| latest | ✅ | Stable releases of Duplicati | +| development | ✅ | Beta releases of Duplicati | ## Application Setup @@ -301,6 +301,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **31.01.25:** - Make `latest` stable releases, move beta releases to `development`. * **28.01.25:** - Add xz-utils. * **03.12.24:** - Add mscorefonts for captcha support. * **29.11.24:** - Rebase to Noble, add support for settings DB encryption. diff --git a/jenkins-vars.yml b/jenkins-vars.yml index 55fb411..7031e4e 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -2,13 +2,14 @@ # jenkins variables project_name: docker-duplicati -external_type: custom_json +external_type: github_stable release_type: stable release_tag: latest ls_branch: master repo_vars: - - JSON_URL = 'https://api.github.com/repos/duplicati/duplicati/releases' - - JSON_PATH = 'first(.[] | select(.tag_name | contains("beta"))) | .tag_name' + - EXT_GIT_BRANCH = 'master' + - EXT_USER = 'duplicati' + - EXT_REPO = 'duplicati' - BUILD_VERSION_ARG = 'DUPLICATI_RELEASE' - LS_USER = 'linuxserver' - LS_REPO = 'docker-duplicati' diff --git a/readme-vars.yml b/readme-vars.yml index ade5bef..917da5f 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -14,8 +14,8 @@ available_architectures: # development version development_versions: true development_versions_items: - - {tag: "latest", desc: "Beta releases of Duplicati"} - - {tag: "development", desc: "Canary releases of Duplicati"} + - {tag: "latest", desc: "Stable releases of Duplicati"} + - {tag: "development", desc: "Beta releases of Duplicati"} # container parameters common_param_env_vars_enabled: true param_container_name: "{{ project_name }}" @@ -82,6 +82,7 @@ init_diagram: | "duplicati:latest" <- Base Images # changelog changelogs: + - {date: "31.01.25:", desc: "Make `latest` stable releases, move beta releases to `development`."} - {date: "28.01.25:", desc: "Add xz-utils."} - {date: "03.12.24:", desc: "Add mscorefonts for captcha support."} - {date: "29.11.24:", desc: "Rebase to Noble, add support for settings DB encryption."}