From 6e8bee00553a8edb3741b259e72e41de8f24e0e3 Mon Sep 17 00:00:00 2001 From: aptalca Date: Mon, 21 Dec 2020 15:47:22 -0500 Subject: [PATCH] publish nightly tag --- .github/workflows/external_trigger.yml | 24 +++--- .github/workflows/package_trigger.yml | 14 ++-- Dockerfile | 5 +- Dockerfile.aarch64 | 5 +- Dockerfile.armhf | 5 +- Jenkinsfile | 106 ++++++++++++------------- README.md | 13 ++- jenkins-vars.yml | 10 +-- readme-vars.yml | 9 ++- 9 files changed, 105 insertions(+), 86 deletions(-) diff --git a/.github/workflows/external_trigger.yml b/.github/workflows/external_trigger.yml index d42b845..ba8d037 100644 --- a/.github/workflows/external_trigger.yml +++ b/.github/workflows/external_trigger.yml @@ -4,24 +4,24 @@ on: workflow_dispatch: jobs: - external-trigger-master: + external-trigger-nightly: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2.3.3 - name: External Trigger - if: github.ref == 'refs/heads/master' + if: github.ref == 'refs/heads/nightly' run: | - if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_MYLAR3_MASTER }}" ]; then - echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_MYLAR3_MASTER is set; skipping trigger. ****" + if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_MYLAR3_NIGHTLY }}" ]; then + echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_MYLAR3_NIGHTLY is set; skipping trigger. ****" exit 0 fi - echo "**** External trigger running off of master branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_MYLAR3_MASTER\". ****" + echo "**** External trigger running off of nightly branch. To disable this trigger, set a Github secret named \"PAUSE_EXTERNAL_TRIGGER_MYLAR3_NIGHTLY\". ****" echo "**** Retrieving external version ****" - 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') + 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) if [ -z "${EXT_RELEASE}" ] || [ "${EXT_RELEASE}" == "null" ]; then echo "**** Can't retrieve external version, exiting ****" - FAILURE_REASON="Can't retrieve external version for mylar3 branch master" + FAILURE_REASON="Can't retrieve external version for mylar3 branch nightly" curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680, "description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}], "username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }} @@ -31,7 +31,7 @@ jobs: echo "**** External version: ${EXT_RELEASE} ****" echo "**** Retrieving last pushed version ****" image="linuxserver/mylar3" - tag="latest" + tag="nightly" token=$(curl -sX GET \ "https://ghcr.io/token?scope=repository%3Alinuxserver%2Fmylar3%3Apull" \ | jq -r '.token') @@ -53,7 +53,7 @@ jobs: IMAGE_VERSION=$(echo ${IMAGE_RELEASE} | awk -F'-ls' '{print $1}') if [ -z "${IMAGE_VERSION}" ]; then echo "**** Can't retrieve last pushed version, exiting ****" - FAILURE_REASON="Can't retrieve last pushed version for mylar3 tag latest" + FAILURE_REASON="Can't retrieve last pushed version for mylar3 tag nightly" curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 16711680, "description": "**Trigger Failed** \n**Reason:** '"${FAILURE_REASON}"' \n"}], "username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }} @@ -63,13 +63,13 @@ jobs: if [ "${EXT_RELEASE}" == "${IMAGE_VERSION}" ]; then echo "**** Version ${EXT_RELEASE} already pushed, exiting ****" exit 0 - elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-mylar3/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then + elif [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-mylar3/job/nightly/lastBuild/api/json | jq -r '.building') == "true" ]; then echo "**** New version ${EXT_RELEASE} found; but there already seems to be an active build on Jenkins; exiting ****" exit 0 else echo "**** New version ${EXT_RELEASE} found; old version was ${IMAGE_VERSION}. Triggering new build ****" response=$(curl -iX POST \ - https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-mylar3/job/master/buildWithParameters?PACKAGE_CHECK=false \ + https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-mylar3/job/nightly/buildWithParameters?PACKAGE_CHECK=false \ --user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|") echo "**** Jenkins job queue url: ${response%$'\r'} ****" echo "**** Sleeping 10 seconds until job starts ****" @@ -84,7 +84,7 @@ jobs: --data-urlencode "description=GHA external trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ --data-urlencode "Submit=Submit" echo "**** Notifying Discord ****" - TRIGGER_REASON="A version change was detected for mylar3 tag latest. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}" + TRIGGER_REASON="A version change was detected for mylar3 tag nightly. Old version:${IMAGE_VERSION} New version:${EXT_RELEASE}" curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903, "description": "**Build Triggered** \n**Reason:** '"${TRIGGER_REASON}"' \n**Build URL:** '"${buildurl}display/redirect"' \n"}], "username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }} diff --git a/.github/workflows/package_trigger.yml b/.github/workflows/package_trigger.yml index 949a1fb..18d3d45 100644 --- a/.github/workflows/package_trigger.yml +++ b/.github/workflows/package_trigger.yml @@ -4,25 +4,25 @@ on: workflow_dispatch: jobs: - package-trigger-master: + package-trigger-nightly: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2.3.3 - name: Package Trigger - if: github.ref == 'refs/heads/master' + if: github.ref == 'refs/heads/nightly' run: | - if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_MYLAR3_MASTER }}" ]; then - echo "**** Github secret PAUSE_PACKAGE_TRIGGER_MYLAR3_MASTER is set; skipping trigger. ****" + if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_MYLAR3_NIGHTLY }}" ]; then + echo "**** Github secret PAUSE_PACKAGE_TRIGGER_MYLAR3_NIGHTLY is set; skipping trigger. ****" exit 0 fi - if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-mylar3/job/master/lastBuild/api/json | jq -r '.building') == "true" ]; then + if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-mylar3/job/nightly/lastBuild/api/json | jq -r '.building') == "true" ]; then echo "**** There already seems to be an active build on Jenkins; skipping package trigger ****" exit 0 fi - echo "**** Package trigger running off of master branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_MYLAR3_MASTER\". ****" + echo "**** Package trigger running off of nightly branch. To disable, set a Github secret named \"PAUSE_PACKAGE_TRIGGER_MYLAR3_NIGHTLY\". ****" response=$(curl -iX POST \ - https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-mylar3/job/master/buildWithParameters?PACKAGE_CHECK=true \ + https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-mylar3/job/nightly/buildWithParameters?PACKAGE_CHECK=true \ --user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} | grep -i location | sed "s|^[L|l]ocation: \(.*\)|\1|") echo "**** Jenkins job queue url: ${response%$'\r'} ****" echo "**** Sleeping 10 seconds until job starts ****" diff --git a/Dockerfile b/Dockerfile index 552d521..30b15c8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,7 @@ RUN \ build-base \ curl \ jpeg-dev \ + jq \ libffi-dev \ py3-cffi \ python3-dev \ @@ -29,8 +30,8 @@ RUN \ pip && \ 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 dc2fe4b..db058ef 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -13,6 +13,7 @@ RUN \ build-base \ curl \ jpeg-dev \ + jq \ libffi-dev \ py3-cffi \ python3-dev \ @@ -29,8 +30,8 @@ RUN \ pip && \ 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.armhf b/Dockerfile.armhf index bac14e1..c41e802 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -13,6 +13,7 @@ RUN \ build-base \ curl \ jpeg-dev \ + jq \ libffi-dev \ py3-cffi \ python3-dev \ @@ -29,8 +30,8 @@ RUN \ pip && \ 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 9c4fb26..51989e0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,7 +16,7 @@ pipeline { GITHUB_TOKEN=credentials('498b4638-2d02-4ce5-832d-8a57d01d97ab') GITLAB_TOKEN=credentials('b6f0f1dd-6952-4cf6-95d1-9c06380283f0') GITLAB_NAMESPACE=credentials('gitlab-namespace-id') - EXT_GIT_BRANCH = 'master' + EXT_GIT_BRANCH = 'python3-dev' EXT_USER = 'mylar3' EXT_REPO = 'mylar3' BUILD_VERSION_ARG = 'MYLAR3_RELEASE' @@ -44,7 +44,7 @@ pipeline { script{ env.EXIT_STATUS = '' env.LS_RELEASE = sh( - script: '''docker run --rm ghcr.io/linuxserver/alexeiled-skopeo sh -c 'skopeo inspect docker://docker.io/'${DOCKERHUB_IMAGE}':latest 2>/dev/null' | jq -r '.Labels.build_version' | awk '{print $3}' | grep '\\-ls' || : ''', + script: '''docker run --rm ghcr.io/linuxserver/alexeiled-skopeo sh -c 'skopeo inspect docker://docker.io/'${DOCKERHUB_IMAGE}':nightly 2>/dev/null' | jq -r '.Labels.build_version' | awk '{print $3}' | grep '\\-ls' || : ''', returnStdout: true).trim() env.LS_RELEASE_NOTES = sh( script: '''cat readme-vars.yml | awk -F \\" '/date: "[0-9][0-9].[0-9][0-9].[0-9][0-9]:/ {print $4;exit;}' | sed -E ':a;N;$!ba;s/\\r{0,1}\\n/\\\\n/g' ''', @@ -101,21 +101,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 -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq -r '. | .tag_name' ''', + script: '''curl -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 } } } @@ -129,10 +129,10 @@ pipeline { } } } - // If this is a master build use live docker endpoints + // If this is a nightly build use live docker endpoints stage("Set ENV live build"){ when { - branch "master" + branch "nightly" environment name: 'CHANGE_ID', value: '' } steps { @@ -141,20 +141,20 @@ pipeline { env.GITHUBIMAGE = 'ghcr.io/' + env.LS_USER + '/' + env.CONTAINER_NAME env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/' + env.CONTAINER_NAME if (env.MULTIARCH == 'true') { - env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + '|arm32v7-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + env.CI_TAGS = 'amd64-nightly-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + '|arm32v7-nightly-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + '|arm64v8-nightly-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER } else { - env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + env.CI_TAGS = 'nightly-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER } env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER - env.META_TAG = env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER - env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN + env.META_TAG = 'nightly-' + env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER + env.EXT_RELEASE_TAG = 'nightly-version-' + env.EXT_RELEASE_CLEAN } } } // If this is a dev build use dev docker endpoints stage("Set ENV dev build"){ when { - not {branch "master"} + not {branch "nightly"} environment name: 'CHANGE_ID', value: '' } steps { @@ -163,13 +163,13 @@ pipeline { env.GITHUBIMAGE = 'ghcr.io/' + env.LS_USER + '/lsiodev-' + env.CONTAINER_NAME env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/lsiodev-' + env.CONTAINER_NAME if (env.MULTIARCH == 'true') { - env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm32v7-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + env.CI_TAGS = 'amd64-nightly-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm32v7-nightly-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + '|arm64v8-nightly-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA } else { - env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + env.CI_TAGS = 'nightly-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA } env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA - env.META_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA - env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN + env.META_TAG = 'nightly-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-dev-' + env.COMMIT_SHA + env.EXT_RELEASE_TAG = 'nightly-version-' + env.EXT_RELEASE_CLEAN env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DEV_DOCKERHUB_IMAGE + '/tags/' } } @@ -185,13 +185,13 @@ pipeline { env.GITHUBIMAGE = 'ghcr.io/' + env.LS_USER + '/lspipepr-' + env.CONTAINER_NAME env.GITLABIMAGE = 'registry.gitlab.com/linuxserver.io/' + env.LS_REPO + '/lspipepr-' + env.CONTAINER_NAME if (env.MULTIARCH == 'true') { - env.CI_TAGS = 'amd64-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + '|arm32v7-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + '|arm64v8-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + env.CI_TAGS = 'amd64-nightly-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + '|arm32v7-nightly-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + '|arm64v8-nightly-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST } else { - env.CI_TAGS = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + env.CI_TAGS = 'nightly-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST } env.VERSION_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST - env.META_TAG = env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST - env.EXT_RELEASE_TAG = 'version-' + env.EXT_RELEASE_CLEAN + env.META_TAG = 'nightly-' + env.EXT_RELEASE_CLEAN + '-pkg-' + env.PACKAGE_TAG + '-pr-' + env.PULL_REQUEST + env.EXT_RELEASE_TAG = 'nightly-version-' + env.EXT_RELEASE_CLEAN env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/pull/' + env.PULL_REQUEST env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.PR_DOCKERHUB_IMAGE + '/tags/' } @@ -229,7 +229,7 @@ pipeline { // Use helper containers to render templated files stage('Update-Templates') { when { - branch "master" + branch "nightly" environment name: 'CHANGE_ID', value: '' expression { env.CONTAINER_NAME != null @@ -240,7 +240,7 @@ pipeline { set -e TEMPDIR=$(mktemp -d) docker pull ghcr.io/linuxserver/jenkins-builder:latest - docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=master -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest + docker run --rm -e CONTAINER_NAME=${CONTAINER_NAME} -e GITHUB_BRANCH=nightly -v ${TEMPDIR}:/ansible/jenkins ghcr.io/linuxserver/jenkins-builder:latest CURRENTHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8) cd ${TEMPDIR}/docker-${CONTAINER_NAME} NEWHASH=$(grep -hs ^ ${TEMPLATED_FILES} | md5sum | cut -c1-8) @@ -248,7 +248,7 @@ pipeline { mkdir -p ${TEMPDIR}/repo git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO} cd ${TEMPDIR}/repo/${LS_REPO} - git checkout -f master + git checkout -f nightly cd ${TEMPDIR}/docker-${CONTAINER_NAME} mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE @@ -283,7 +283,7 @@ pipeline { // Exit the build if the Templated files were just updated stage('Template-exit') { when { - branch "master" + branch "nightly" environment name: 'CHANGE_ID', value: '' environment name: 'FILES_UPDATED', value: 'true' expression { @@ -392,7 +392,7 @@ pipeline { // Take the image we just built and dump package versions for comparison stage('Update-packages') { when { - branch "master" + branch "nightly" environment name: 'CHANGE_ID', value: '' environment name: 'EXIT_STATUS', value: '' } @@ -420,7 +420,7 @@ pipeline { echo "Package tag sha from current packages in buit container is ${NEW_PACKAGE_TAG} comparing to old ${PACKAGE_TAG} from github" if [ "${NEW_PACKAGE_TAG}" != "${PACKAGE_TAG}" ]; then git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/${LS_REPO} - git --git-dir ${TEMPDIR}/${LS_REPO}/.git checkout -f master + git --git-dir ${TEMPDIR}/${LS_REPO}/.git checkout -f nightly cp ${TEMPDIR}/package_versions.txt ${TEMPDIR}/${LS_REPO}/ cd ${TEMPDIR}/${LS_REPO}/ wait @@ -444,7 +444,7 @@ pipeline { // Exit the build if the package file was just updated stage('PACKAGE-exit') { when { - branch "master" + branch "nightly" environment name: 'CHANGE_ID', value: '' environment name: 'PACKAGE_UPDATED', value: 'true' environment name: 'EXIT_STATUS', value: '' @@ -465,7 +465,7 @@ pipeline { // Exit the build if this is just a package check and there are no changes to push stage('PACKAGECHECK-exit') { when { - branch "master" + branch "nightly" environment name: 'CHANGE_ID', value: '' environment name: 'PACKAGE_UPDATED', value: 'false' environment name: 'EXIT_STATUS', value: '' @@ -561,9 +561,9 @@ pipeline { echo $GITLAB_TOKEN | docker login registry.gitlab.com -u LinuxServer.io --password-stdin for PUSHIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${IMAGE}"; do docker tag ${IMAGE}:${META_TAG} ${PUSHIMAGE}:${META_TAG} - docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:latest + docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:nightly docker tag ${PUSHIMAGE}:${META_TAG} ${PUSHIMAGE}:${EXT_RELEASE_TAG} - docker push ${PUSHIMAGE}:latest + docker push ${PUSHIMAGE}:nightly docker push ${PUSHIMAGE}:${META_TAG} docker push ${PUSHIMAGE}:${EXT_RELEASE_TAG} done @@ -574,7 +574,7 @@ pipeline { docker rmi \ ${DELETEIMAGE}:${META_TAG} \ ${DELETEIMAGE}:${EXT_RELEASE_TAG} \ - ${DELETEIMAGE}:latest || : + ${DELETEIMAGE}:nightly || : done ''' } @@ -611,25 +611,25 @@ pipeline { docker tag ${IMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG} docker tag ${IMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} docker tag ${IMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} - docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-latest - docker tag ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-latest - docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-latest + docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-nightly + docker tag ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-nightly + docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-nightly docker tag ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} docker tag ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} docker tag ${MANIFESTIMAGE}:arm64v8-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} docker push ${MANIFESTIMAGE}:amd64-${META_TAG} docker push ${MANIFESTIMAGE}:arm32v7-${META_TAG} docker push ${MANIFESTIMAGE}:arm64v8-${META_TAG} - docker push ${MANIFESTIMAGE}:amd64-latest - docker push ${MANIFESTIMAGE}:arm32v7-latest - docker push ${MANIFESTIMAGE}:arm64v8-latest + docker push ${MANIFESTIMAGE}:amd64-nightly + docker push ${MANIFESTIMAGE}:arm32v7-nightly + docker push ${MANIFESTIMAGE}:arm64v8-nightly docker push ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} docker push ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} docker push ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} - docker manifest push --purge ${MANIFESTIMAGE}:latest || : - docker manifest create ${MANIFESTIMAGE}:latest ${MANIFESTIMAGE}:amd64-latest ${MANIFESTIMAGE}:arm32v7-latest ${MANIFESTIMAGE}:arm64v8-latest - docker manifest annotate ${MANIFESTIMAGE}:latest ${MANIFESTIMAGE}:arm32v7-latest --os linux --arch arm - docker manifest annotate ${MANIFESTIMAGE}:latest ${MANIFESTIMAGE}:arm64v8-latest --os linux --arch arm64 --variant v8 + docker manifest push --purge ${MANIFESTIMAGE}:nightly || : + docker manifest create ${MANIFESTIMAGE}:nightly ${MANIFESTIMAGE}:amd64-nightly ${MANIFESTIMAGE}:arm32v7-nightly ${MANIFESTIMAGE}:arm64v8-nightly + docker manifest annotate ${MANIFESTIMAGE}:nightly ${MANIFESTIMAGE}:arm32v7-nightly --os linux --arch arm + docker manifest annotate ${MANIFESTIMAGE}:nightly ${MANIFESTIMAGE}:arm64v8-nightly --os linux --arch arm64 --variant v8 docker manifest push --purge ${MANIFESTIMAGE}:${META_TAG} || : docker manifest create ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm32v7-${META_TAG} --os linux --arch arm @@ -638,7 +638,7 @@ pipeline { docker manifest create ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} docker manifest annotate ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm32v7-${EXT_RELEASE_TAG} --os linux --arch arm docker manifest annotate ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} --os linux --arch arm64 --variant v8 - docker manifest push --purge ${MANIFESTIMAGE}:latest + docker manifest push --purge ${MANIFESTIMAGE}:nightly docker manifest push --purge ${MANIFESTIMAGE}:${META_TAG} docker manifest push --purge ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} done @@ -648,13 +648,13 @@ pipeline { for DELETEIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${IMAGE}"; do docker rmi \ ${DELETEIMAGE}:amd64-${META_TAG} \ - ${DELETEIMAGE}:amd64-latest \ + ${DELETEIMAGE}:amd64-nightly \ ${DELETEIMAGE}:amd64-${EXT_RELEASE_TAG} \ ${DELETEIMAGE}:arm32v7-${META_TAG} \ - ${DELETEIMAGE}:arm32v7-latest \ + ${DELETEIMAGE}:arm32v7-nightly \ ${DELETEIMAGE}:arm32v7-${EXT_RELEASE_TAG} \ ${DELETEIMAGE}:arm64v8-${META_TAG} \ - ${DELETEIMAGE}:arm64v8-latest \ + ${DELETEIMAGE}:arm64v8-nightly \ ${DELETEIMAGE}:arm64v8-${EXT_RELEASE_TAG} || : done docker rmi \ @@ -667,7 +667,7 @@ pipeline { // If this is a public release tag it in the LS Github stage('Github-Tag-Push-Release') { when { - branch "master" + branch "nightly" expression { env.LS_RELEASE != env.EXT_RELEASE_CLEAN + '-ls' + env.LS_TAG_NUMBER } @@ -679,17 +679,17 @@ pipeline { sh '''curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/git/tags \ -d '{"tag":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\ "object": "'${COMMIT_SHA}'",\ - "message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to master",\ + "message": "Tagging Release '${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}' to nightly",\ "type": "commit",\ "tagger": {"name": "LinuxServer Jenkins","email": "jenkins@linuxserver.io","date": "'${GITHUB_DATE}'"}}' ''' echo "Pushing New release for Tag" sh '''#! /bin/bash - curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/releases/latest | jq '. |.body' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json + curl -s https://api.github.com/repos/${EXT_USER}/${EXT_REPO}/commits/${EXT_GIT_BRANCH} | jq '. | .commit.message' | sed 's:^.\\(.*\\).$:\\1:' > releasebody.json echo '{"tag_name":"'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\ - "target_commitish": "master",\ + "target_commitish": "nightly",\ "name": "'${EXT_RELEASE_CLEAN}'-ls'${LS_TAG_NUMBER}'",\ "body": "**LinuxServer Changes:**\\n\\n'${LS_RELEASE_NOTES}'\\n**'${EXT_REPO}' Changes:**\\n\\n' > start - printf '","draft": false,"prerelease": false}' >> releasebody.json + printf '","draft": false,"prerelease": true}' >> releasebody.json paste -d'\\0' start releasebody.json > releasebody.json.done curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${LS_USER}/${LS_REPO}/releases -d @releasebody.json.done''' } diff --git a/README.md b/README.md index 363fdd0..afefeab 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Find us at: [![MicroBadger Layers](https://img.shields.io/microbadger/layers/linuxserver/mylar3.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge)](https://microbadger.com/images/linuxserver/mylar3 "Get your own version badge on microbadger.com") [![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/mylar3.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/linuxserver/mylar3) [![Docker Stars](https://img.shields.io/docker/stars/linuxserver/mylar3.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/linuxserver/mylar3) -[![Jenkins Build](https://img.shields.io/jenkins/build?labelColor=555555&logoColor=ffffff&style=for-the-badge&jobUrl=https%3A%2F%2Fci.linuxserver.io%2Fjob%2FDocker-Pipeline-Builders%2Fjob%2Fdocker-mylar3%2Fjob%2Fmaster%2F&logo=jenkins)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-mylar3/job/master/) +[![Jenkins Build](https://img.shields.io/jenkins/build?labelColor=555555&logoColor=ffffff&style=for-the-badge&jobUrl=https%3A%2F%2Fci.linuxserver.io%2Fjob%2FDocker-Pipeline-Builders%2Fjob%2Fdocker-mylar3%2Fjob%2Fnightly%2F&logo=jenkins)](https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-mylar3/job/nightly/) [![LSIO CI](https://img.shields.io/badge/dynamic/yaml?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=CI&query=CI&url=https%3A%2F%2Fci-tests.linuxserver.io%2Flinuxserver%2Fmylar3%2Flatest%2Fci-status.yml)](https://ci-tests.linuxserver.io/linuxserver/mylar3/latest/index.html) [Mylar3](https://github.com/mylar3/mylar3) is an automated Comic Book downloader (cbr/cbz) for use with NZB and torrents written in python. It supports SABnzbd, NZBGET, and many torrent clients in addition to DDL. @@ -56,6 +56,14 @@ The architectures supported by this image are: | arm64 | arm64v8-latest | | armhf | arm32v7-latest | +## Version Tags + +This image provides various versions that are available via tags. `latest` tag usually provides the latest stable version. Others are considered under development and caution must be exercised when using them. + +| Tag | Description | +| :----: | --- | +| latest | Stable Mylar3 releases | +| nightly | Commits to Mylar3 `python3-dev` branch | ## Usage @@ -148,7 +156,7 @@ In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as bel ## Application Setup The web ui for settings etc, is on `:8090` -For more detailed setup refer [Mylar3](https://github.com/mylar3/mylar3). +For more detailed setup options, refer to [Mylar3](https://github.com/mylar3/mylar3). ## Docker Mods @@ -222,4 +230,5 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **21.12.20:** - Release `nightly` tag based on commits to upstream `python3-dev` branch. * **28.09.20:** - Initial release. diff --git a/jenkins-vars.yml b/jenkins-vars.yml index 0bb614e..f90e8ec 100644 --- a/jenkins-vars.yml +++ b/jenkins-vars.yml @@ -2,12 +2,12 @@ # jenkins variables project_name: docker-mylar3 -external_type: github_stable -release_type: stable -release_tag: latest -ls_branch: master +external_type: github_commit +release_type: prerelease +release_tag: nightly +ls_branch: nightly 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 ed7815b..f2d5305 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -13,6 +13,12 @@ available_architectures: - { arch: "{{ arch_arm64 }}", tag: "arm64v8-latest"} - { arch: "{{ arch_armhf }}", tag: "arm32v7-latest"} +# development version +development_versions: true +development_versions_items: + - { tag: "latest", desc: "Stable Mylar3 releases" } + - { tag: "nightly", desc: "Commits to Mylar3 `python3-dev` branch" } + # container parameters param_container_name: "{{ project_name }}" param_usage_include_vols: true @@ -30,8 +36,9 @@ param_ports: app_setup_block_enabled: true app_setup_block: | The web ui for settings etc, is on `:8090` - For more detailed setup refer [{{ project_name|capitalize }}]({{ project_url }}). + For more detailed setup options, refer to [{{ project_name|capitalize }}]({{ project_url }}). # changelog changelogs: + - { date: "21.12.20:", desc: "Release `nightly` tag based on commits to upstream `python3-dev` branch."} - { date: "28.09.20:", desc: "Initial release."}