diff --git a/.github/workflows/external_trigger.yml b/.github/workflows/external_trigger.yml index 8cd1711..1696c19 100644 --- a/.github/workflows/external_trigger.yml +++ b/.github/workflows/external_trigger.yml @@ -29,8 +29,8 @@ jobs: echo "> [!NOTE]" >> $GITHUB_STEP_SUMMARY echo "> External trigger running off of master branch. To disable this trigger, add \`mylar3_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/mylar3/mylar3/releases/latest" | jq -r '. | .tag_name') - echo "Type is \`github_stable\`" >> $GITHUB_STEP_SUMMARY + EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/mylar3/mylar3/commits/python3-dev" | jq -r '. | .sha' | cut -c1-8) + echo "Type is \`github_commit\`" >> $GITHUB_STEP_SUMMARY if grep -q "^mylar3_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 ee2e20f..9ccfeef 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 -FROM ghcr.io/linuxserver/unrar:latest as unrar +FROM ghcr.io/linuxserver/unrar:latest AS unrar FROM ghcr.io/linuxserver/baseimage-ubuntu:jammy @@ -32,8 +32,8 @@ RUN \ zlib1g-dev && \ echo "**** install mylar3 ****" && \ if [ -z ${MYLAR3_RELEASE+x} ]; then \ - MYLAR3_RELEASE=$(curl -sX GET https://api.github.com/repos/mylar3/mylar3/releases/latest \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ + MYLAR3_RELEASE=$(curl -sX GET https://api.github.com/repos/mylar3/mylar3/commits/python3-dev \ + | jq -r '.sha' | cut -c1-8); \ fi && \ mkdir /app/mylar3 && \ curl -o \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index 6c02b0a..8225221 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -1,6 +1,6 @@ # syntax=docker/dockerfile:1 -FROM ghcr.io/linuxserver/unrar:arm64v8-latest as unrar +FROM ghcr.io/linuxserver/unrar:arm64v8-latest AS unrar FROM ghcr.io/linuxserver/baseimage-ubuntu:arm64v8-jammy @@ -32,8 +32,8 @@ RUN \ zlib1g-dev && \ echo "**** install mylar3 ****" && \ if [ -z ${MYLAR3_RELEASE+x} ]; then \ - MYLAR3_RELEASE=$(curl -sX GET https://api.github.com/repos/mylar3/mylar3/releases/latest \ - | awk '/tag_name/{print $4;exit}' FS='[""]'); \ + MYLAR3_RELEASE=$(curl -sX GET https://api.github.com/repos/mylar3/mylar3/commits/python3-dev \ + | jq -r '.sha' | cut -c1-8); \ fi && \ mkdir /app/mylar3 && \ curl -o \ diff --git a/Jenkinsfile b/Jenkinsfile index 952e7c8..8279965 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,7 +19,7 @@ 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') - EXT_GIT_BRANCH = 'master' + EXT_GIT_BRANCH = 'python3-dev' EXT_USER = 'mylar3' EXT_REPO = 'mylar3' BUILD_VERSION_ARG = 'MYLAR3_RELEASE' @@ -145,21 +145,21 @@ pipeline { /* ######################## External Release Tagging ######################## */ - // If this is a stable github release use the latest endpoint from github to determine the ext tag - stage("Set ENV github_stable"){ + // If this is a github commit trigger determine the current commit at head + stage("Set ENV github_commit"){ steps{ script{ env.EXT_RELEASE = sh( - script: '''curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''', + script: '''curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/commits/${EXT_GIT_BRANCH} | jq -r '. | .sha' | cut -c1-8 ''', returnStdout: true).trim() } } } - // If this is a stable or devel github release generate the link for the build message - stage("Set ENV github_link"){ + // If this is a github commit trigger Set the external release link + stage("Set ENV commit_link"){ steps{ script{ - env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/releases/tag/' + env.EXT_RELEASE + env.RELEASE_LINK = 'https://github.com/' + env.EXT_USER + '/' + env.EXT_REPO + '/commit/' + env.EXT_RELEASE } } } @@ -1030,7 +1030,7 @@ pipeline { "type": "commit",\ "tagger": {"name": "LinuxServer-CI","email": "ci@linuxserver.io","date": "'${GITHUB_DATE}'"}}' echo "Pushing New release for Tag" - curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. |.body' > releasebody.json + curl -H "Authorization: token ${GITHUB_TOKEN}" -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/commits/${EXT_RELEASE_CLEAN} | jq -r '.commit.message' > releasebody.json jq -n \ --arg tag_name "$META_TAG" \ --arg target_commitish "master" \ diff --git a/README.md b/README.md index a60ddc7..c0a4b0e 100644 --- a/README.md +++ b/README.md @@ -60,9 +60,9 @@ This image provides various versions that are available via tags. Please read th | Tag | Available | Description | | :----: | :----: |--- | -| latest | ✅ | Stable Mylar3 releases | -| nightly | ✅ | Commits to Mylar3 `python3-dev` branch | -| unstable | ✅ | Commits to Mylar3 `1000papercuts` branch | +| latest | ✅ | Commits to Mylar3 `python3-dev` branch | +| nightly | ✅ | Commits to Mylar3 `1000papercuts` branch (ubuntu) | +| unstable | ✅ | Commits to Mylar3 `1000papercuts` branch (alpine) | ## Application Setup @@ -289,6 +289,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **19.02.26:** - Rebase `latest` tag based on commits to upstream `python3-dev` branch. `nightly` will build commits to upstream `1000papercuts` branch. `unstable` tag will also build commits to upstream `1000papercuts` branch, but on alpine 3.23 with python 3.12. * **05.02.26:** - Release `unstable` tag based on commits to upstream `1000papercuts` branch. * **21.11.25:** - Rebase to Ubuntu Jammy. * **23.12.23:** - Rebase to Alpine 3.19. diff --git a/jenkins-vars.yml b/jenkins-vars.yml index ea2e284..8f23718 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -2,12 +2,12 @@ # jenkins variables project_name: docker-mylar3 -external_type: github_stable +external_type: github_commit release_type: stable release_tag: latest ls_branch: master repo_vars: - - EXT_GIT_BRANCH = 'master' + - EXT_GIT_BRANCH = 'python3-dev' - EXT_USER = 'mylar3' - EXT_REPO = 'mylar3' - BUILD_VERSION_ARG = 'MYLAR3_RELEASE' diff --git a/readme-vars.yml b/readme-vars.yml index be4274a..90bcb5e 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -14,9 +14,9 @@ available_architectures: # development version development_versions: true development_versions_items: - - {tag: "latest", desc: "Stable Mylar3 releases"} - - {tag: "nightly", desc: "Commits to Mylar3 `python3-dev` branch"} - - {tag: "unstable", desc: "Commits to Mylar3 `1000papercuts` branch"} + - {tag: "latest", desc: "Commits to Mylar3 `python3-dev` branch"} + - {tag: "nightly", desc: "Commits to Mylar3 `1000papercuts` branch (ubuntu)"} + - {tag: "unstable", desc: "Commits to Mylar3 `1000papercuts` branch (alpine)"} # container parameters param_container_name: "{{ project_name }}" param_usage_include_vols: true @@ -80,6 +80,7 @@ init_diagram: | "mylar3:latest" <- Base Images # changelog changelogs: + - {date: "19.02.26:", desc: "Rebase `latest` tag based on commits to upstream `python3-dev` branch. `nightly` will build commits to upstream `1000papercuts` branch. `unstable` tag will also build commits to upstream `1000papercuts` branch, but on alpine 3.23 with python 3.12."} - {date: "05.02.26:", desc: "Release `unstable` tag based on commits to upstream `1000papercuts` branch."} - {date: "21.11.25:", desc: "Rebase to Ubuntu Jammy."} - {date: "23.12.23:", desc: "Rebase to Alpine 3.19."}