@@ -94,7 +94,7 @@ pipeline {
9494 env. CODE_URL = ' https://github.com/' + env. LS_USER + ' /' + env. LS_REPO + ' /commit/' + env. GIT_COMMIT
9595 env. DOCKERHUB_LINK = ' https://hub.docker.com/r/' + env. DOCKERHUB_IMAGE + ' /tags/'
9696 env. PULL_REQUEST = env. CHANGE_ID
97- 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 '
97+ 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 '
9898 if ( env. SYFT_IMAGE_TAG == null ) {
9999 env. SYFT_IMAGE_TAG = ' latest'
100100 }
@@ -333,6 +333,7 @@ pipeline {
333333 fi
334334 echo "Starting Stage 2 - Delete old templates"
335335 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"
336+ OLD_TEMPLATES="${OLD_TEMPLATES} $(echo .github/workflows/{external_trigger,external_trigger_scheduler,package_trigger_scheduler,call_issue_pr_tracker,call_issues_cron}.yml)"
336337 for i in ${OLD_TEMPLATES}; do
337338 if [[ -f "${i}" ]]; then
338339 TEMPLATES_TO_DELETE="${i} ${TEMPLATES_TO_DELETE}"
@@ -397,6 +398,10 @@ pipeline {
397398 cd ${TEMPDIR}/docker-${CONTAINER_NAME}
398399 mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows
399400 mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE
401+ mkdir -p \
402+ ${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d/init-deprecate/dependencies.d \
403+ ${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d/init-services/dependencies.d \
404+ ${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d/user/contents.d
400405 cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/ || :
401406 cp --parents readme-vars.yml ${TEMPDIR}/repo/${LS_REPO}/ || :
402407 cd ${TEMPDIR}/repo/${LS_REPO}/
@@ -426,6 +431,19 @@ pipeline {
426431 git add docs/images/docker-${CONTAINER_NAME}.md
427432 echo "Updating docs repo"
428433 git commit -m 'Bot Updating Documentation'
434+ git mv docs/images/docker-${CONTAINER_NAME}.md docs/deprecated_images/docker-${CONTAINER_NAME}.md || :
435+ if ! command -v yq || ! yq --help | grep -q 'mikefarah'; then
436+ YQ_DL_VERSION=$(curl -fsX GET "https://api.github.com/repos/mikefarah/yq/releases/latest" | jq -r '. | .tag_name')
437+ echo "No yq found, retrieving from upstream release version ${YQ_DL_VERSION}"
438+ curl -fo /usr/local/bin/yq -L "https://github.com/mikefarah/yq/releases/download/${YQ_DL_VERSION}/yq_linux_amd64"
439+ chmod +x /usr/local/bin/yq
440+ fi
441+ if ! yq -e '.plugins.[].redirects.redirect_maps.[] | select(. == "deprecated_images/docker-" + env(CONTAINER_NAME) + ".md")' mkdocs.yml >/dev/null 2>&1; then
442+ echo "Updating mkdocs.yml with deprecation info"
443+ yq -i '(.plugins.[] | select(.redirects)).redirects.redirect_maps |= . + {"images/docker-" + env(CONTAINER_NAME) + ".md" : "deprecated_images/docker-" + env(CONTAINER_NAME) + ".md"}' mkdocs.yml
444+ git add mkdocs.yml
445+ fi
446+ git commit -m 'Bot Moving Deprecated Documentation' || :
429447 git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} --rebase
430448 git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} || \
431449 (MAXWAIT="10" && echo "Push to docs failed, trying again in ${MAXWAIT} seconds" && \
@@ -447,6 +465,10 @@ pipeline {
447465 echo "Updating Unraid template"
448466 cd ${TEMPDIR}/unraid/templates/
449467 GH_TEMPLATES_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||')
468+ if ! grep -wq "^${CONTAINER_NAME}$" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
469+ echo "${CONTAINER_NAME}" >> ${TEMPDIR}/unraid/templates/unraid/ignore.list
470+ git add unraid/ignore.list
471+ fi
450472 if grep -wq "^${CONTAINER_NAME}$" ${TEMPDIR}/unraid/templates/unraid/ignore.list && [[ -f ${TEMPDIR}/unraid/templates/unraid/deprecated/${CONTAINER_NAME}.xml ]]; then
451473 echo "Image is on the ignore list, and already in the deprecation folder."
452474 elif grep -wq "^${CONTAINER_NAME}$" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
@@ -940,6 +962,7 @@ pipeline {
940962 docker buildx imagetools create --prefer-index=false -t ${PUSHIMAGE}:${SEMVER} ${CACHEIMAGE}:amd64-${COMMIT_SHA}-${BUILD_NUMBER} || \
941963 { if [[ "${PUSHIMAGE}" != "${QUAYIMAGE}" ]]; then exit 1; fi; }
942964 fi
965+ docker buildx imagetools create -t ${PUSHIMAGE}:ubuntu-xfce ghcr.io/linuxserver/jenkins-builder:empty || true
943966 done
944967 '''
945968 }
@@ -975,8 +998,7 @@ pipeline {
975998 fi
976999 done
9771000 for MANIFESTIMAGE in "${IMAGE}" "${GITLABIMAGE}" "${GITHUBIMAGE}" "${QUAYIMAGE}"; do
978- docker buildx imagetools create -t ${MANIFESTIMAGE}:ubuntu-xfce ${MANIFESTIMAGE}:amd64-ubuntu-xfce ${MANIFESTIMAGE}:arm64v8-ubuntu-xfce || \
979- { if [[ "${MANIFESTIMAGE}" != "${QUAYIMAGE}" ]]; then exit 1; fi; }
1001+ docker buildx imagetools create -t ${MANIFESTIMAGE}:ubuntu-xfce -t ${MANIFESTIMAGE}:amd64-ubuntu-xfce -t ${MANIFESTIMAGE}:arm64v8-ubuntu-xfce ghcr.io/linuxserver/jenkins-builder:empty || true
9801002 docker buildx imagetools create -t ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG} || \
9811003 { if [[ "${MANIFESTIMAGE}" != "${QUAYIMAGE}" ]]; then exit 1; fi; }
9821004 docker buildx imagetools create -t ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG} || \
@@ -1073,6 +1095,26 @@ EOF
10731095 ) '''
10741096 }
10751097 }
1098+ stage(' Deprecate/Disable Future Builds' ) {
1099+ when {
1100+ branch " ubuntu-xfce"
1101+ environment name : ' CHANGE_ID' , value : ' '
1102+ environment name : ' EXIT_STATUS' , value : ' '
1103+ }
1104+ steps {
1105+ sh ''' #! /bin/bash
1106+ TEMPDIR=$(mktemp -d)
1107+ mkdir -p ${TEMPDIR}/repo
1108+ git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
1109+ cd ${TEMPDIR}/repo/${LS_REPO}
1110+ git checkout -f ubuntu-xfce
1111+ git rm Jenkinsfile
1112+ git commit -m 'Disabling future builds'
1113+ git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git ubuntu-xfce
1114+ git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git ubuntu-xfce
1115+ rm -Rf ${TEMPDIR}'''
1116+ }
1117+ }
10761118 }
10771119 /* ######################
10781120 Comment on PR and Send status to Discord
0 commit comments