@@ -96,7 +96,7 @@ pipeline {
9696 env. CODE_URL = ' https://github.com/' + env. LS_USER + ' /' + env. LS_REPO + ' /commit/' + env. GIT_COMMIT
9797 env. DOCKERHUB_LINK = ' https://hub.docker.com/r/' + env. DOCKERHUB_IMAGE + ' /tags/'
9898 env. PULL_REQUEST = env. CHANGE_ID
99- 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 '
99+ 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 '
100100 }
101101 sh ''' #! /bin/bash
102102 echo "The default github branch detected as ${GH_DEFAULT_BRANCH}" '''
@@ -337,6 +337,7 @@ pipeline {
337337 fi
338338 echo "Starting Stage 2 - Delete old templates"
339339 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"
340+ OLD_TEMPLATES="${OLD_TEMPLATES} $(echo .github/workflows/{external_trigger,external_trigger_scheduler,package_trigger_scheduler,call_issue_pr_tracker,call_issues_cron}.yml)"
340341 for i in ${OLD_TEMPLATES}; do
341342 if [[ -f "${i}" ]]; then
342343 TEMPLATES_TO_DELETE="${i} ${TEMPLATES_TO_DELETE}"
@@ -401,6 +402,10 @@ pipeline {
401402 cd ${TEMPDIR}/docker-${CONTAINER_NAME}
402403 mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows
403404 mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE
405+ mkdir -p \
406+ ${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d/init-deprecate/dependencies.d \
407+ ${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d/init-services/dependencies.d \
408+ ${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d/user/contents.d
404409 cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/ || :
405410 cp --parents readme-vars.yml ${TEMPDIR}/repo/${LS_REPO}/ || :
406411 cd ${TEMPDIR}/repo/${LS_REPO}/
@@ -430,6 +435,19 @@ pipeline {
430435 git add docs/images/docker-${CONTAINER_NAME}.md
431436 echo "Updating docs repo"
432437 git commit -m 'Bot Updating Documentation'
438+ git mv docs/images/docker-${CONTAINER_NAME}.md docs/deprecated_images/docker-${CONTAINER_NAME}.md || :
439+ if ! command -v yq || ! yq --help | grep -q 'mikefarah'; then
440+ YQ_DL_VERSION=$(curl -fsX GET "https://api.github.com/repos/mikefarah/yq/releases/latest" | jq -r '. | .tag_name')
441+ echo "No yq found, retrieving from upstream release version ${YQ_DL_VERSION}"
442+ curl -fo /usr/local/bin/yq -L "https://github.com/mikefarah/yq/releases/download/${YQ_DL_VERSION}/yq_linux_amd64"
443+ chmod +x /usr/local/bin/yq
444+ fi
445+ if ! yq -e '.plugins.[].redirects.redirect_maps.[] | select(. == "deprecated_images/docker-" + env(CONTAINER_NAME) + ".md")' mkdocs.yml >/dev/null 2>&1; then
446+ echo "Updating mkdocs.yml with deprecation info"
447+ yq -i '(.plugins.[] | select(.redirects)).redirects.redirect_maps |= . + {"images/docker-" + env(CONTAINER_NAME) + ".md" : "deprecated_images/docker-" + env(CONTAINER_NAME) + ".md"}' mkdocs.yml
448+ git add mkdocs.yml
449+ fi
450+ git commit -m 'Bot Moving Deprecated Documentation' || :
433451 git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} --rebase
434452 git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} || \
435453 (MAXWAIT="10" && echo "Push to docs failed, trying again in ${MAXWAIT} seconds" && \
@@ -451,6 +469,10 @@ pipeline {
451469 echo "Updating Unraid template"
452470 cd ${TEMPDIR}/unraid/templates/
453471 GH_TEMPLATES_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||')
472+ if ! grep -wq "^${CONTAINER_NAME}$" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
473+ echo "${CONTAINER_NAME}" >> ${TEMPDIR}/unraid/templates/unraid/ignore.list
474+ git add unraid/ignore.list
475+ fi
454476 if grep -wq "^${CONTAINER_NAME}$" ${TEMPDIR}/unraid/templates/unraid/ignore.list && [[ -f ${TEMPDIR}/unraid/templates/unraid/deprecated/${CONTAINER_NAME}.xml ]]; then
455477 echo "Image is on the ignore list, and already in the deprecation folder."
456478 elif grep -wq "^${CONTAINER_NAME}$" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
@@ -930,6 +952,7 @@ pipeline {
930952 if [ -n "${SEMVER}" ]; then
931953 docker buildx imagetools create --prefer-index=false -t ${PUSHIMAGE}:${SEMVER} ${CACHEIMAGE}:amd64-${COMMIT_SHA}-${BUILD_NUMBER}
932954 fi
955+ docker buildx imagetools create -t ${PUSHIMAGE}:latest ghcr.io/linuxserver/jenkins-builder:empty || true
933956 done
934957 '''
935958 }
@@ -961,7 +984,7 @@ pipeline {
961984 fi
962985 done
963986 for MANIFESTIMAGE in "${IMAGE}" "${GITLABIMAGE}" "${GITHUBIMAGE}" "${QUAYIMAGE}"; do
964- docker buildx imagetools create -t ${MANIFESTIMAGE}:latest ${MANIFESTIMAGE}:amd64-latest ${MANIFESTIMAGE}:arm64v8-latest
987+ docker buildx imagetools create -t ${MANIFESTIMAGE}:latest -t ${MANIFESTIMAGE}:amd64-latest -t ${MANIFESTIMAGE}:arm64v8-latest ghcr.io/linuxserver/jenkins-builder:empty || true
965988 docker buildx imagetools create -t ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG}
966989
967990 docker buildx imagetools create -t ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG}
@@ -1116,6 +1139,26 @@ EOF
11161139
11171140 }
11181141 }
1142+ stage(' Deprecate/Disable Future Builds' ) {
1143+ when {
1144+ branch " master"
1145+ environment name : ' CHANGE_ID' , value : ' '
1146+ environment name : ' EXIT_STATUS' , value : ' '
1147+ }
1148+ steps {
1149+ sh ''' #! /bin/bash
1150+ TEMPDIR=$(mktemp -d)
1151+ mkdir -p ${TEMPDIR}/repo
1152+ git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
1153+ cd ${TEMPDIR}/repo/${LS_REPO}
1154+ git checkout -f master
1155+ git rm Jenkinsfile
1156+ git commit -m 'Disabling future builds'
1157+ git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master
1158+ git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master
1159+ rm -Rf ${TEMPDIR}'''
1160+ }
1161+ }
11191162 }
11201163 /* ######################
11211164 Send status to Discord
0 commit comments