From 71d9cf9ad2bce28b32c97039bb1b254ef23c8fb5 Mon Sep 17 00:00:00 2001 From: aptalca Date: Mon, 21 Dec 2020 16:06:49 -0500 Subject: [PATCH] deprecate --- .github/ISSUE_TEMPLATE/config.yml | 13 +++ .../issue.bug.md} | 10 +- .github/ISSUE_TEMPLATE/issue.feature.md | 25 +++++ .github/workflows/external_trigger.yml | 91 +++++++++++++++++++ .../workflows/external_trigger_scheduler.yml | 43 +++++++++ .github/workflows/package_trigger.yml | 38 ++++++++ .../workflows/package_trigger_scheduler.yml | 50 ++++++++++ Jenkinsfile | 46 ++++++++-- README.md | 5 +- readme-vars.yml | 3 + root/etc/cont-init.d/90-deprecate | 21 +++++ 11 files changed, 331 insertions(+), 14 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/config.yml rename .github/{ISSUE_TEMPLATE.md => ISSUE_TEMPLATE/issue.bug.md} (77%) create mode 100644 .github/ISSUE_TEMPLATE/issue.feature.md create mode 100644 .github/workflows/external_trigger.yml create mode 100644 .github/workflows/external_trigger_scheduler.yml create mode 100644 .github/workflows/package_trigger.yml create mode 100644 .github/workflows/package_trigger_scheduler.yml create mode 100644 root/etc/cont-init.d/90-deprecate diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 0000000..31f2695 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,13 @@ +blank_issues_enabled: false +contact_links: + - name: Discord chat support + url: https://discord.gg/YWrKVTn + about: Realtime support / chat with the community and the team. + + - name: Discourse discussion forum + url: https://discourse.linuxserver.io + about: Post on our community forum. + + - name: Documentation + url: https://docs.linuxserver.io/images/docker-mylar + about: Documentation - information about all of our containers. diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE/issue.bug.md similarity index 77% rename from .github/ISSUE_TEMPLATE.md rename to .github/ISSUE_TEMPLATE/issue.bug.md index 8ad54c4..67b895b 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE/issue.bug.md @@ -1,12 +1,14 @@ +--- +name: Bug report +about: Create a report to help us improve + +--- [linuxserverurl]: https://linuxserver.io [![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] - - - - + ------------------------------ diff --git a/.github/ISSUE_TEMPLATE/issue.feature.md b/.github/ISSUE_TEMPLATE/issue.feature.md new file mode 100644 index 0000000..20a91fd --- /dev/null +++ b/.github/ISSUE_TEMPLATE/issue.feature.md @@ -0,0 +1,25 @@ +--- +name: Feature request +about: Suggest an idea for this project + +--- +[linuxserverurl]: https://linuxserver.io +[![linuxserver.io](https://raw.githubusercontent.com/linuxserver/docker-templates/master/linuxserver.io/img/linuxserver_medium.png)][linuxserverurl] + + + + + + + + +------------------------------ + +## Desired Behavior + + +## Current Behavior + + +## Alternatives Considered + diff --git a/.github/workflows/external_trigger.yml b/.github/workflows/external_trigger.yml new file mode 100644 index 0000000..df6df21 --- /dev/null +++ b/.github/workflows/external_trigger.yml @@ -0,0 +1,91 @@ +name: External Trigger Main + +on: + workflow_dispatch: + +jobs: + external-trigger-master: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.3 + + - name: External Trigger + if: github.ref == 'refs/heads/master' + run: | + if [ -n "${{ secrets.PAUSE_EXTERNAL_TRIGGER_MYLAR_MASTER }}" ]; then + echo "**** Github secret PAUSE_EXTERNAL_TRIGGER_MYLAR_MASTER 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_MYLAR_MASTER\". ****" + echo "**** Retrieving external version ****" + EXT_RELEASE=$(curl -u "${{ secrets.CR_USER }}:${{ secrets.CR_PAT }}" -sX GET "https://api.github.com/repos/evilhero/mylar/commits/master" | 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 mylar branch master" + 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 }} + exit 1 + fi + EXT_RELEASE=$(echo ${EXT_RELEASE} | sed 's/[~,%@+;:/]//g') + echo "**** External version: ${EXT_RELEASE} ****" + echo "**** Retrieving last pushed version ****" + image="linuxserver/mylar" + tag="latest" + token=$(curl -sX GET \ + "https://ghcr.io/token?scope=repository%3Alinuxserver%2Fmylar%3Apull" \ + | jq -r '.token') + multidigest=$(curl -s \ + --header "Accept: application/vnd.docker.distribution.manifest.v2+json" \ + --header "Authorization: Bearer ${token}" \ + "https://ghcr.io/v2/${image}/manifests/${tag}" \ + | jq -r 'first(.manifests[].digest)') + digest=$(curl -s \ + --header "Accept: application/vnd.docker.distribution.manifest.v2+json" \ + --header "Authorization: Bearer ${token}" \ + "https://ghcr.io/v2/${image}/manifests/${multidigest}" \ + | jq -r '.config.digest') + image_info=$(curl -sL \ + --header "Authorization: Bearer ${token}" \ + "https://ghcr.io/v2/${image}/blobs/${digest}" \ + | jq -r '.container_config') + IMAGE_RELEASE=$(echo ${image_info} | jq -r '.Labels.build_version' | awk '{print $3}') + 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 mylar tag latest" + 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 }} + exit 1 + fi + echo "**** Last pushed version: ${IMAGE_VERSION} ****" + 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-mylar/job/master/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-mylar/job/master/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 ****" + sleep 10 + buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url') + buildurl="${buildurl%$'\r'}" + echo "**** Jenkins job build url: ${buildurl} ****" + echo "**** Attempting to change the Jenkins job description ****" + curl -iX POST \ + "${buildurl}submitDescription" \ + --user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \ + --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 mylar tag latest. 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 }} + fi diff --git a/.github/workflows/external_trigger_scheduler.yml b/.github/workflows/external_trigger_scheduler.yml new file mode 100644 index 0000000..1320d53 --- /dev/null +++ b/.github/workflows/external_trigger_scheduler.yml @@ -0,0 +1,43 @@ +name: External Trigger Scheduler + +on: + schedule: + - cron: '00 * * * *' + workflow_dispatch: + +jobs: + external-trigger-scheduler: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.3 + with: + fetch-depth: '0' + + - name: External Trigger Scheduler + run: | + echo "**** Branches found: ****" + git for-each-ref --format='%(refname:short)' refs/remotes + echo "**** Pulling the yq docker image ****" + docker pull ghcr.io/linuxserver/yq + for br in $(git for-each-ref --format='%(refname:short)' refs/remotes) + do + br=$(echo "$br" | sed 's|origin/||g') + echo "**** Evaluating branch ${br} ****" + ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-mylar/${br}/jenkins-vars.yml \ + | docker run --rm -i --entrypoint yq ghcr.io/linuxserver/yq -r .ls_branch) + if [ "$br" == "$ls_branch" ]; then + echo "**** Branch ${br} appears to be live; checking workflow. ****" + if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-mylar/${br}/.github/workflows/external_trigger.yml > /dev/null 2>&1; then + echo "**** Workflow exists. Triggering external trigger workflow for branch ${br} ****." + curl -iX POST \ + -H "Authorization: token ${{ secrets.CR_PAT }}" \ + -H "Accept: application/vnd.github.v3+json" \ + -d "{\"ref\":\"refs/heads/${br}\"}" \ + https://api.github.com/repos/linuxserver/docker-mylar/actions/workflows/external_trigger.yml/dispatches + else + echo "**** Workflow doesn't exist; skipping trigger. ****" + fi + else + echo "**** ${br} appears to be a dev branch; skipping trigger. ****" + fi + done diff --git a/.github/workflows/package_trigger.yml b/.github/workflows/package_trigger.yml new file mode 100644 index 0000000..8e382a3 --- /dev/null +++ b/.github/workflows/package_trigger.yml @@ -0,0 +1,38 @@ +name: Package Trigger Main + +on: + workflow_dispatch: + +jobs: + package-trigger-master: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.3 + + - name: Package Trigger + if: github.ref == 'refs/heads/master' + run: | + if [ -n "${{ secrets.PAUSE_PACKAGE_TRIGGER_MYLAR_MASTER }}" ]; then + echo "**** Github secret PAUSE_PACKAGE_TRIGGER_MYLAR_MASTER is set; skipping trigger. ****" + exit 0 + fi + if [ $(curl -s https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-mylar/job/master/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_MYLAR_MASTER\". ****" + response=$(curl -iX POST \ + https://ci.linuxserver.io/job/Docker-Pipeline-Builders/job/docker-mylar/job/master/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 ****" + sleep 10 + buildurl=$(curl -s "${response%$'\r'}api/json" | jq -r '.executable.url') + buildurl="${buildurl%$'\r'}" + echo "**** Jenkins job build url: ${buildurl} ****" + echo "**** Attempting to change the Jenkins job description ****" + curl -iX POST \ + "${buildurl}submitDescription" \ + --user ${{ secrets.JENKINS_USER }}:${{ secrets.JENKINS_TOKEN }} \ + --data-urlencode "description=GHA package trigger https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" \ + --data-urlencode "Submit=Submit" diff --git a/.github/workflows/package_trigger_scheduler.yml b/.github/workflows/package_trigger_scheduler.yml new file mode 100644 index 0000000..623c3b7 --- /dev/null +++ b/.github/workflows/package_trigger_scheduler.yml @@ -0,0 +1,50 @@ +name: Package Trigger Scheduler + +on: + schedule: + - cron: '33 8 * * 2' + workflow_dispatch: + +jobs: + package-trigger-scheduler: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.3.3 + with: + fetch-depth: '0' + + - name: Package Trigger Scheduler + run: | + echo "**** Branches found: ****" + git for-each-ref --format='%(refname:short)' refs/remotes + echo "**** Pulling the yq docker image ****" + docker pull ghcr.io/linuxserver/yq + for br in $(git for-each-ref --format='%(refname:short)' refs/remotes) + do + br=$(echo "$br" | sed 's|origin/||g') + echo "**** Evaluating branch ${br} ****" + ls_branch=$(curl -sX GET https://raw.githubusercontent.com/linuxserver/docker-mylar/${br}/jenkins-vars.yml \ + | docker run --rm -i --entrypoint yq ghcr.io/linuxserver/yq -r .ls_branch) + if [ "${br}" == "${ls_branch}" ]; then + echo "**** Branch ${br} appears to be live; checking workflow. ****" + if curl -sfX GET https://raw.githubusercontent.com/linuxserver/docker-mylar/${br}/.github/workflows/package_trigger.yml > /dev/null 2>&1; then + echo "**** Workflow exists. Triggering package trigger workflow for branch ${br}. ****" + triggered_branches="${triggered_branches}${br} " + curl -iX POST \ + -H "Authorization: token ${{ secrets.CR_PAT }}" \ + -H "Accept: application/vnd.github.v3+json" \ + -d "{\"ref\":\"refs/heads/${br}\"}" \ + https://api.github.com/repos/linuxserver/docker-mylar/actions/workflows/package_trigger.yml/dispatches + sleep 30 + else + echo "**** Workflow doesn't exist; skipping trigger. ****" + fi + else + echo "**** ${br} appears to be a dev branch; skipping trigger. ****" + fi + done + echo "**** Package check build(s) triggered for branch(es): ${triggered_branches} ****" + echo "**** Notifying Discord ****" + curl -X POST -H "Content-Type: application/json" --data '{"avatar_url": "https://cdn.discordapp.com/avatars/354986384542662657/df91181b3f1cf0ef1592fbe18e0962d7.png","embeds": [{"color": 9802903, + "description": "**Package Check Build(s) Triggered for mylar** \n**Branch(es):** '"${triggered_branches}"' \n**Build URL:** '"https://ci.linuxserver.io/blue/organizations/jenkins/Docker-Pipeline-Builders%2Fdocker-mylar/activity/"' \n"}], + "username": "Github Actions"}' ${{ secrets.DISCORD_WEBHOOK }} diff --git a/Jenkinsfile b/Jenkinsfile index c8dc97f..3ec02e6 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -58,7 +58,7 @@ pipeline { env.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/commit/' + env.GIT_COMMIT env.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DOCKERHUB_IMAGE + '/tags/' env.PULL_REQUEST = env.CHANGE_ID - env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE ./.github/CONTRIBUTING.md ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE.md ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/greetings.yml ./.github/workflows/stale.yml' + env.TEMPLATED_FILES = 'Jenkinsfile README.md LICENSE ./.github/CONTRIBUTING.md ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE/config.yml ./.github/ISSUE_TEMPLATE/issue.bug.md ./.github/ISSUE_TEMPLATE/issue.feature.md ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/greetings.yml ./.github/workflows/stale.yml ./.github/workflows/package_trigger.yml ./.github/workflows/package_trigger_scheduler.yml ./.github/workflows/external_trigger.yml ./.github/workflows/external_trigger_scheduler.yml' } script{ env.LS_RELEASE_NUMBER = sh( @@ -145,6 +145,7 @@ pipeline { } else { env.CI_TAGS = 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 } @@ -166,6 +167,7 @@ pipeline { } else { env.CI_TAGS = 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.DOCKERHUB_LINK = 'https://hub.docker.com/r/' + env.DEV_DOCKERHUB_IMAGE + '/tags/' @@ -187,6 +189,7 @@ pipeline { } else { env.CI_TAGS = 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.CODE_URL = 'https://github.com/' + env.LS_USER + '/' + env.LS_REPO + '/pull/' + env.PULL_REQUEST @@ -248,9 +251,12 @@ pipeline { git checkout -f master cd ${TEMPDIR}/docker-${CONTAINER_NAME} mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows - cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/ + mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE + rm -f ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE.md + cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/ || : cd ${TEMPDIR}/repo/${LS_REPO}/ git add ${TEMPLATED_FILES} + git rm .github/ISSUE_TEMPLATE.md || : git commit -m 'Bot Updating Templated Files' git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all echo "true" > /tmp/${COMMIT_SHA}-${BUILD_NUMBER} @@ -320,8 +326,9 @@ pipeline { environment name: 'EXIT_STATUS', value: '' } steps { + echo "Running on node: ${NODE_NAME}" sh "docker build --no-cache --pull -t ${IMAGE}:${META_TAG} \ - --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ." + --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ." } } // Build MultiArch Docker containers for push to LS Repo @@ -333,8 +340,9 @@ pipeline { parallel { stage('Build X86') { steps { + echo "Running on node: ${NODE_NAME}" sh "docker build --no-cache --pull -t ${IMAGE}:amd64-${META_TAG} \ - --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ." + --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ." } } stage('Build ARMHF') { @@ -342,12 +350,13 @@ pipeline { label 'ARMHF' } steps { + echo "Running on node: ${NODE_NAME}" echo 'Logging into Github' sh '''#! /bin/bash echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin ''' sh "docker build --no-cache --pull -f Dockerfile.armhf -t ${IMAGE}:arm32v7-${META_TAG} \ - --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ." + --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ." sh "docker tag ${IMAGE}:arm32v7-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}" retry(5) { sh "docker push ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER}" @@ -362,12 +371,13 @@ pipeline { label 'ARM64' } steps { + echo "Running on node: ${NODE_NAME}" echo 'Logging into Github' sh '''#! /bin/bash echo $GITHUB_TOKEN | docker login ghcr.io -u LinuxServer-CI --password-stdin ''' sh "docker build --no-cache --pull -f Dockerfile.aarch64 -t ${IMAGE}:arm64v8-${META_TAG} \ - --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${META_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ." + --build-arg ${BUILD_VERSION_ARG}=${EXT_RELEASE} --build-arg VERSION=\"${VERSION_TAG}\" --build-arg BUILD_DATE=${GITHUB_DATE} ." sh "docker tag ${IMAGE}:arm64v8-${META_TAG} ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}" retry(5) { sh "docker push ghcr.io/linuxserver/lsiodev-buildcache:arm64v8-${COMMIT_SHA}-${BUILD_NUMBER}" @@ -440,6 +450,13 @@ pipeline { environment name: 'EXIT_STATUS', value: '' } steps { + sh '''#! /bin/bash + echo "Packages were updated. Cleaning up the image and exiting." + if [ "${MULTIARCH}" == "true" ]; then + docker rmi ${IMAGE}:amd64-${META_TAG} + else + docker rmi ${IMAGE}:${META_TAG} + fi''' script{ env.EXIT_STATUS = 'ABORTED' } @@ -457,6 +474,13 @@ pipeline { } } steps { + sh '''#! /bin/bash + echo "There are no package updates. Cleaning up the image and exiting." + if [ "${MULTIARCH}" == "true" ]; then + docker rmi ${IMAGE}:amd64-${META_TAG} + else + docker rmi ${IMAGE}:${META_TAG} + fi''' script{ env.EXIT_STATUS = 'ABORTED' } @@ -546,7 +570,7 @@ pipeline { ''' } sh '''#! /bin/bash - for DELETEIMAGE in "${GITHUBIMAGE}" "{GITLABIMAGE}" "${IMAGE}"; do + for DELETEIMAGE in "${GITHUBIMAGE}" "${GITLABIMAGE}" "${IMAGE}"; do docker rmi \ ${DELETEIMAGE}:${META_TAG} \ ${DELETEIMAGE}:${EXT_RELEASE_TAG} \ @@ -610,6 +634,7 @@ pipeline { 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 docker manifest annotate ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} --os linux --arch arm64 --variant v8 + docker manifest push --purge ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} || : 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 @@ -624,10 +649,13 @@ pipeline { docker rmi \ ${DELETEIMAGE}:amd64-${META_TAG} \ ${DELETEIMAGE}:amd64-latest \ + ${DELETEIMAGE}:amd64-${EXT_RELEASE_TAG} \ ${DELETEIMAGE}:arm32v7-${META_TAG} \ ${DELETEIMAGE}:arm32v7-latest \ + ${DELETEIMAGE}:arm32v7-${EXT_RELEASE_TAG} \ ${DELETEIMAGE}:arm64v8-${META_TAG} \ - ${DELETEIMAGE}:arm64v8-latest || : + ${DELETEIMAGE}:arm64v8-latest \ + ${DELETEIMAGE}:arm64v8-${EXT_RELEASE_TAG} || : done docker rmi \ ghcr.io/linuxserver/lsiodev-buildcache:arm32v7-${COMMIT_SHA}-${BUILD_NUMBER} \ @@ -694,7 +722,7 @@ pipeline { -e DOCKER_REPOSITORY=${IMAGE} \ -e GIT_BRANCH=master \ -v ${TEMPDIR}/docker-${CONTAINER_NAME}:/mnt \ - ghcr.io/linuxserver/lsiodev-readme-sync bash -c 'node sync' + ghcr.io/linuxserver/lsiodev-readme-sync bash -c 'node sync' rm -Rf ${TEMPDIR} ''' } } diff --git a/README.md b/README.md index 59f490f..9cf6531 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Find us at: [![GitHub Stars](https://img.shields.io/github/stars/linuxserver/docker-mylar.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/linuxserver/docker-mylar) [![GitHub Release](https://img.shields.io/github/release/linuxserver/docker-mylar.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&logo=github)](https://github.com/linuxserver/docker-mylar/releases) [![GitHub Package Repository](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitHub%20Package&logo=github)](https://github.com/linuxserver/docker-mylar/packages) -[![GitLab Container Registry](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitLab%20Registry&logo=gitlab)](https://gitlab.com/Linuxserver.io/docker-mylar/container_registry) +[![GitLab Container Registry](https://img.shields.io/static/v1.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=linuxserver.io&message=GitLab%20Registry&logo=gitlab)](https://gitlab.com/linuxserver.io/docker-mylar/container_registry) [![MicroBadger Layers](https://img.shields.io/microbadger/layers/linuxserver/mylar.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge)](https://microbadger.com/images/linuxserver/mylar "Get your own version badge on microbadger.com") [![Docker Pulls](https://img.shields.io/docker/pulls/linuxserver/mylar.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=pulls&logo=docker)](https://hub.docker.com/r/linuxserver/mylar) [![Docker Stars](https://img.shields.io/docker/stars/linuxserver/mylar.svg?color=94398d&labelColor=555555&logoColor=ffffff&style=for-the-badge&label=stars&logo=docker)](https://hub.docker.com/r/linuxserver/mylar) @@ -147,6 +147,8 @@ In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as bel   ## Application Setup +THIS IMAGE IS DEPRECATED. Please migrate to [Mylar3](https://github.com/linuxserver/docker-mylar3). + The web ui for settings etc, is on `:8090` For more detailed setup refer [Mylar](https://github.com/evilhero/mylar). @@ -222,6 +224,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **21.12.20:** - Deprecated. Please migrate to [Mylar3](https://github.com/linuxserver/docker-mylar3). * **19.12.19:** - Rebasing to alpine 3.11. * **28.06.19:** - Rebasing to alpine 3.10. * **08.05.19:** - Re-install requests pip package to downgrade urllib version suitable for mylar. diff --git a/readme-vars.yml b/readme-vars.yml index 9cfff45..e7c8ae5 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -29,11 +29,14 @@ param_ports: # application setup block app_setup_block_enabled: true app_setup_block: | + THIS IMAGE IS DEPRECATED. Please migrate to [Mylar3](https://github.com/linuxserver/docker-mylar3). + The web ui for settings etc, is on `:8090` For more detailed setup refer [{{ project_name|capitalize }}]({{ project_url }}). # changelog changelogs: + - { date: "21.12.20:", desc: "Deprecated. Please migrate to [Mylar3](https://github.com/linuxserver/docker-mylar3)." } - { date: "19.12.19:", desc: "Rebasing to alpine 3.11." } - { date: "28.06.19:", desc: "Rebasing to alpine 3.10." } - { date: "08.05.19:", desc: "Re-install requests pip package to downgrade urllib version suitable for mylar." } diff --git a/root/etc/cont-init.d/90-deprecate b/root/etc/cont-init.d/90-deprecate new file mode 100644 index 0000000..aade85a --- /dev/null +++ b/root/etc/cont-init.d/90-deprecate @@ -0,0 +1,21 @@ +#!/usr/bin/with-contenv bash + +echo ' +****************************************************** +****************************************************** +* * +* * +* This image has been deprecated * +* * +* Use the new image at * +* * +* linuxserver/mylar3 * +* * +* https://hub.docker.com/r/linuxserver/mylar3 * +* * +* https://github.com/linuxserver/docker-mylar3 * +* * +* * +* * +****************************************************** +******************************************************' \ No newline at end of file