diff --git a/.github/workflows/external_trigger.yml b/.github/workflows/external_trigger.yml index 6fbe349..4a839f5 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 main branch. To disable this trigger, add \`yaak_main\` 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/mountain-loop/yaak/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/mountain-loop/yaak/releases | jq -r '.[] | select(.prerelease != true) | select(.tag_name | contains("yaak-cli") | not) | .tag_name' | sort -rV | head -1) + echo "Type is \`custom_version_command\`" >> $GITHUB_STEP_SUMMARY if grep -q "^yaak_main_${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 @@ -110,6 +110,12 @@ jobs: echo "New version \`${EXT_RELEASE}\` found; but there already seems to be an active build on Jenkins; exiting" >> $GITHUB_STEP_SUMMARY exit 0 else + assets=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/mountain-loop/yaak/releases/tags/${EXT_RELEASE}" | jq -r '.assets[].browser_download_url') + if grep -q "arm64.deb$" <<< "${assets}" && grep -q "amd64.deb$" <<< "${assets}"; then + artifacts_found="true" + else + artifacts_found="false" + fi if [[ "${artifacts_found}" == "false" ]]; then echo "> [!WARNING]" >> $GITHUB_STEP_SUMMARY echo "> New version detected, but not all artifacts are published yet; skipping trigger" >> $GITHUB_STEP_SUMMARY diff --git a/Dockerfile b/Dockerfile index a56f84d..3a865a1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,8 +21,9 @@ RUN \ echo "**** install yaak ****" && \ apt-get update && \ if [ -z ${YAAK_RELEASE+x} ]; then \ - YAAK_RELEASE=$(curl -sX GET "https://api.github.com/repos/mountain-loop/yaak/releases/latest" \ - | jq -r .tag_name); \ + YAAK_RELEASE=$(curl -sX GET https://api.github.com/repos/mountain-loop/yaak/releases \ + | jq -r '.[] | select(.prerelease != true) | select(.tag_name | contains("yaak-cli") | not) | .tag_name' \ + | sort -rV | head -1); \ fi && \ YAAK_URL=$(curl -sX GET "https://api.github.com/repos/mountain-loop/yaak/releases/tags/${YAAK_RELEASE}" | jq -r '.assets[].browser_download_url' \ | grep "amd64" | grep ".deb$") && \ diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 new file mode 100644 index 0000000..5b862f9 --- /dev/null +++ b/Dockerfile.aarch64 @@ -0,0 +1,44 @@ +# syntax=docker/dockerfile:1 + +FROM ghcr.io/linuxserver/baseimage-selkies:arm64v8-ubuntunoble + +# set version label +ARG BUILD_DATE +ARG VERSION +ARG YAAK_RELEASE +LABEL build_version="Linuxserver.io version:- ${VERSION} Build-date:- ${BUILD_DATE}" +LABEL maintainer="aptalca" + +ENV \ + HOME="/config" \ + TITLE="Yaak" + +RUN \ + echo "**** add icon ****" && \ + curl -o \ + /usr/share/selkies/www/icon.png \ + https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/yaak-icon.png && \ + echo "**** install yaak ****" && \ + apt-get update && \ + if [ -z ${YAAK_RELEASE+x} ]; then \ + YAAK_RELEASE=$(curl -sX GET https://api.github.com/repos/mountain-loop/yaak/releases \ + | jq -r '.[] | select(.prerelease != true) | select(.tag_name | contains("yaak-cli") | not) | .tag_name' \ + | sort -rV | head -1); \ + fi && \ + YAAK_URL=$(curl -sX GET "https://api.github.com/repos/mountain-loop/yaak/releases/tags/${YAAK_RELEASE}" | jq -r '.assets[].browser_download_url' \ + | grep "arm64" | grep ".deb$") && \ + curl -fo \ + /tmp/yaak.deb -L \ + "${YAAK_URL}" && \ + apt-get install -y --no-install-recommends \ + /tmp/yaak.deb && \ + printf "Linuxserver.io version: ${VERSION}\nBuild-date: ${BUILD_DATE}" > /build_version && \ + echo "**** cleanup ****" && \ + apt-get clean && \ + rm -rf \ + /tmp/* \ + /var/lib/apt/lists/* \ + /var/tmp/* + +# add local files +COPY root/ / diff --git a/Jenkinsfile b/Jenkinsfile index 708f1fc..2c36fcd 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,9 +19,6 @@ 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_USER = 'mountain-loop' - EXT_REPO = 'yaak' BUILD_VERSION_ARG = 'YAAK_RELEASE' LS_USER = 'linuxserver' LS_REPO = 'docker-yaak' @@ -30,7 +27,7 @@ pipeline { DEV_DOCKERHUB_IMAGE = 'lsiodev/yaak' PR_DOCKERHUB_IMAGE = 'lspipepr/yaak' DIST_IMAGE = 'ubuntu' - MULTIARCH = 'false' + MULTIARCH = 'true' CI = 'true' CI_WEB = 'true' CI_PORT = '3001' @@ -145,23 +142,16 @@ 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"){ - 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' ''', - returnStdout: true).trim() - } - } - } - // 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 - } - } + // If this is a custom command to determine version use that command + stage("Set tag custom bash"){ + steps{ + script{ + env.EXT_RELEASE = sh( + script: ''' curl -sX GET https://api.github.com/repos/mountain-loop/yaak/releases | jq -r '.[] | select(.prerelease != true) | select(.tag_name | contains("yaak-cli") | not) | .tag_name' | sort -rV | head -1 ''', + returnStdout: true).trim() + env.RELEASE_LINK = 'custom_command' + } + } } // Sanitize the release tag and strip illegal docker or github characters stage("Sanitize tag"){ @@ -1030,7 +1020,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 + echo "Updating to ${EXT_RELEASE_CLEAN}" > releasebody.json jq -n \ --arg tag_name "$META_TAG" \ --arg target_commitish "main" \ diff --git a/README.md b/README.md index 2835ed9..ab7522f 100644 --- a/README.md +++ b/README.md @@ -574,6 +574,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **11.03.26:** - Push aarch64 image. Update external trigger. * **28.12.25:** - Add Wayland init logic. * **29.07.25:** - Rebase to selkies. Breaking Change: HTTPS is now required. Either use a reverse proxy with SSL cert or direct connect to port 8181 with HTTPS. * **12.09.24:** - Initial release. diff --git a/jenkins-vars.yml b/jenkins-vars.yml index 3d0c0bd..ca24a39 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -2,14 +2,19 @@ # jenkins variables project_name: docker-yaak -external_type: github_stable +external_type: na +custom_version_command: "curl -sX GET https://api.github.com/repos/mountain-loop/yaak/releases | jq -r '.[] | select(.prerelease != true) | select(.tag_name | contains(\"yaak-cli\") | not) | .tag_name' | sort -rV | head -1" release_type: stable release_tag: latest ls_branch: main +external_artifact_check: | + assets=$(curl -u "${{ '{{' }} secrets.CR_USER {{ '}}' }}:${{ '{{' }} secrets.CR_PAT {{ '}}' }}" -sX GET "https://api.github.com/repos/mountain-loop/yaak/releases/tags/${EXT_RELEASE}" | jq -r '.assets[].browser_download_url') + if grep -q "arm64.deb$" <<< "${assets}" && grep -q "amd64.deb$" <<< "${assets}"; then + artifacts_found="true" + else + artifacts_found="false" + fi repo_vars: - - EXT_GIT_BRANCH = 'master' - - EXT_USER = 'mountain-loop' - - EXT_REPO = 'yaak' - BUILD_VERSION_ARG = 'YAAK_RELEASE' - LS_USER = 'linuxserver' - LS_REPO = 'docker-yaak' @@ -18,7 +23,7 @@ repo_vars: - DEV_DOCKERHUB_IMAGE = 'lsiodev/yaak' - PR_DOCKERHUB_IMAGE = 'lspipepr/yaak' - DIST_IMAGE = 'ubuntu' - - MULTIARCH = 'false' + - MULTIARCH = 'true' - CI = 'true' - CI_WEB = 'true' - CI_PORT = '3001' diff --git a/readme-vars.yml b/readme-vars.yml index 56f3188..08fa2bd 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -101,6 +101,7 @@ init_diagram: | "yaak:latest" <- Base Images # changelog changelogs: + - {date: "11.03.26:", desc: "Push aarch64 image. Update external trigger."} - {date: "28.12.25:", desc: "Add Wayland init logic."} - {date: "29.07.25:", desc: "Rebase to selkies. Breaking Change: HTTPS is now required. Either use a reverse proxy with SSL cert or direct connect to port 8181 with HTTPS."} - {date: "12.09.24:", desc: "Initial release."}