@@ -93,7 +93,7 @@ pipeline {
9393 env. CODE_URL = ' https://github.com/' + env. LS_USER + ' /' + env. LS_REPO + ' /commit/' + env. GIT_COMMIT
9494 env. DOCKERHUB_LINK = ' https://hub.docker.com/r/' + env. DOCKERHUB_IMAGE + ' /tags/'
9595 env. PULL_REQUEST = env. CHANGE_ID
96- env. TEMPLATED_FILES = ' Jenkinsfile README.md LICENSE .editorconfig ./.github/CONTRIBUTING.md ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE/config.yml ./.github/ISSUE_TEMPLATE/issue.bug.yml ./.github/ISSUE_TEMPLATE/issue.feature.yml ./.github/PULL_REQUEST_TEMPLATE.md ./.github/workflows/external_trigger_scheduler.yml ./.github/workflows/greetings.yml ./.github/workflows/package_trigger_scheduler.yml ./.github/workflows/call_issue_pr_tracker.yml ./.github/workflows/call_issues_cron.yml ./.github/workflows/permissions.yml ./.github/workflows/external_trigger.yml '
96+ env. TEMPLATED_FILES = ' Jenkinsfile README.md LICENSE .editorconfig ./.github/CONTRIBUTING.md ./.github/FUNDING.yml ./.github/ISSUE_TEMPLATE/config.yml ./.github/ISSUE_TEMPLATE/issue.bug.yml ./.github/ISSUE_TEMPLATE/issue.feature.yml ./.github/PULL_REQUEST_TEMPLATE.md ./root/etc/s6-overlay/s6-rc.d/init-deprecate/run ./root/etc/s6-overlay/s6-rc.d/init-deprecate/up ./root/etc/s6-overlay/s6-rc.d/init-deprecate/type ./root/etc/s6-overlay/s6-rc.d/init-deprecate/dependencies.d/init-config-end ./root/etc/s6-overlay/s6-rc.d/init-services/dependencies.d/init-deprecate ./root/etc/s6-overlay/s6-rc.d/user/contents.d/init-deprecate '
9797 }
9898 sh ''' #! /bin/bash
9999 echo "The default github branch detected as ${GH_DEFAULT_BRANCH}" '''
@@ -327,6 +327,7 @@ pipeline {
327327 fi
328328 echo "Starting Stage 2 - Delete old templates"
329329 OLD_TEMPLATES=".github/ISSUE_TEMPLATE.md .github/ISSUE_TEMPLATE/issue.bug.md .github/ISSUE_TEMPLATE/issue.feature.md .github/workflows/call_invalid_helper.yml .github/workflows/stale.yml .github/workflows/package_trigger.yml"
330+ OLD_TEMPLATES="${OLD_TEMPLATES} $(echo .github/workflows/{external_trigger,external_trigger_scheduler,package_trigger_scheduler,call_issue_pr_tracker,call_issues_cron}.yml)"
330331 for i in ${OLD_TEMPLATES}; do
331332 if [[ -f "${i}" ]]; then
332333 TEMPLATES_TO_DELETE="${i} ${TEMPLATES_TO_DELETE}"
@@ -391,6 +392,10 @@ pipeline {
391392 cd ${TEMPDIR}/docker-${CONTAINER_NAME}
392393 mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows
393394 mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE
395+ mkdir -p \
396+ ${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d/init-deprecate/dependencies.d \
397+ ${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d/init-services/dependencies.d \
398+ ${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d/user/contents.d
394399 cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/ || :
395400 cp --parents readme-vars.yml ${TEMPDIR}/repo/${LS_REPO}/ || :
396401 cd ${TEMPDIR}/repo/${LS_REPO}/
@@ -420,6 +425,19 @@ pipeline {
420425 git add docs/images/docker-${CONTAINER_NAME}.md
421426 echo "Updating docs repo"
422427 git commit -m 'Bot Updating Documentation'
428+ git mv docs/images/docker-${CONTAINER_NAME}.md docs/deprecated_images/docker-${CONTAINER_NAME}.md || :
429+ if ! command -v yq || ! yq --help | grep -q 'mikefarah'; then
430+ YQ_DL_VERSION=$(curl -fsX GET "https://api.github.com/repos/mikefarah/yq/releases/latest" | jq -r '. | .tag_name')
431+ echo "No yq found, retrieving from upstream release version ${YQ_DL_VERSION}"
432+ curl -fo /usr/local/bin/yq -L "https://github.com/mikefarah/yq/releases/download/${YQ_DL_VERSION}/yq_linux_amd64"
433+ chmod +x /usr/local/bin/yq
434+ fi
435+ if ! yq -e '.plugins.[].redirects.redirect_maps.[] | select(. == "deprecated_images/docker-" + env(CONTAINER_NAME) + ".md")' mkdocs.yml >/dev/null 2>&1; then
436+ echo "Updating mkdocs.yml with deprecation info"
437+ yq -i '(.plugins.[] | select(.redirects)).redirects.redirect_maps |= . + {"images/docker-" + env(CONTAINER_NAME) + ".md" : "deprecated_images/docker-" + env(CONTAINER_NAME) + ".md"}' mkdocs.yml
438+ git add mkdocs.yml
439+ fi
440+ git commit -m 'Bot Moving Deprecated Documentation' || :
423441 git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} --rebase
424442 git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} || \
425443 (MAXWAIT="10" && echo "Push to docs failed, trying again in ${MAXWAIT} seconds" && \
@@ -441,6 +459,10 @@ pipeline {
441459 echo "Updating Unraid template"
442460 cd ${TEMPDIR}/unraid/templates/
443461 GH_TEMPLATES_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||')
462+ if ! grep -wq "^${CONTAINER_NAME}$" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
463+ echo "${CONTAINER_NAME}" >> ${TEMPDIR}/unraid/templates/unraid/ignore.list
464+ git add unraid/ignore.list
465+ fi
444466 if grep -wq "^${CONTAINER_NAME}$" ${TEMPDIR}/unraid/templates/unraid/ignore.list && [[ -f ${TEMPDIR}/unraid/templates/unraid/deprecated/${CONTAINER_NAME}.xml ]]; then
445467 echo "Image is on the ignore list, and already in the deprecation folder."
446468 elif grep -wq "^${CONTAINER_NAME}$" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
@@ -920,6 +942,7 @@ pipeline {
920942 if [ -n "${SEMVER}" ]; then
921943 docker buildx imagetools create --prefer-index=false -t ${PUSHIMAGE}:${SEMVER} ${CACHEIMAGE}:amd64-${COMMIT_SHA}-${BUILD_NUMBER}
922944 fi
945+ docker buildx imagetools create -t ${PUSHIMAGE}:latest ghcr.io/linuxserver/jenkins-builder:empty || true
923946 done
924947 '''
925948 }
@@ -951,7 +974,7 @@ pipeline {
951974 fi
952975 done
953976 for MANIFESTIMAGE in "${IMAGE}" "${GITLABIMAGE}" "${GITHUBIMAGE}" "${QUAYIMAGE}"; do
954- docker buildx imagetools create -t ${MANIFESTIMAGE}:latest ${MANIFESTIMAGE}:amd64-latest ${MANIFESTIMAGE}:arm64v8-latest
977+ docker buildx imagetools create -t ${MANIFESTIMAGE}:latest -t ${MANIFESTIMAGE}:amd64-latest -t ${MANIFESTIMAGE}:arm64v8-latest ghcr.io/linuxserver/jenkins-builder:empty || true
955978 docker buildx imagetools create -t ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG}
956979
957980 docker buildx imagetools create -t ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG}
@@ -1106,6 +1129,26 @@ EOF
11061129
11071130 }
11081131 }
1132+ stage(' Deprecate/Disable Future Builds' ) {
1133+ when {
1134+ branch " master"
1135+ environment name : ' CHANGE_ID' , value : ' '
1136+ environment name : ' EXIT_STATUS' , value : ' '
1137+ }
1138+ steps {
1139+ sh ''' #! /bin/bash
1140+ TEMPDIR=$(mktemp -d)
1141+ mkdir -p ${TEMPDIR}/repo
1142+ git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
1143+ cd ${TEMPDIR}/repo/${LS_REPO}
1144+ git checkout -f master
1145+ git rm Jenkinsfile
1146+ git commit -m 'Disabling future builds'
1147+ git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master
1148+ git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master
1149+ rm -Rf ${TEMPDIR}'''
1150+ }
1151+ }
11091152 }
11101153 /* ######################
11111154 Send status to Discord
0 commit comments