@@ -84,7 +84,7 @@ pipeline {
84
84
env. CODE_URL = ' https://github.com/' + env. LS_USER + ' /' + env. LS_REPO + ' /commit/' + env. GIT_COMMIT
85
85
env. DOCKERHUB_LINK = ' https://hub.docker.com/r/' + env. DOCKERHUB_IMAGE + ' /tags/'
86
86
env. PULL_REQUEST = env. CHANGE_ID
87
- 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 '
87
+ 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 '
88
88
}
89
89
sh ''' #! /bin/bash
90
90
echo "The default github branch detected as ${GH_DEFAULT_BRANCH}" '''
@@ -325,6 +325,7 @@ pipeline {
325
325
fi
326
326
echo "Starting Stage 2 - Delete old templates"
327
327
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"
328
+ OLD_TEMPLATES="${OLD_TEMPLATES} $(echo .github/workflows/{external_trigger,external_trigger_scheduler,package_trigger_scheduler,call_issue_pr_tracker,call_issues_cron}.yml)"
328
329
for i in ${OLD_TEMPLATES}; do
329
330
if [[ -f "${i}" ]]; then
330
331
TEMPLATES_TO_DELETE="${i} ${TEMPLATES_TO_DELETE}"
@@ -389,6 +390,10 @@ pipeline {
389
390
cd ${TEMPDIR}/docker-${CONTAINER_NAME}
390
391
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows
391
392
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE
393
+ mkdir -p \
394
+ ${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d/init-deprecate/dependencies.d \
395
+ ${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d/init-services/dependencies.d \
396
+ ${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d/user/contents.d
392
397
cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/ || :
393
398
cp --parents readme-vars.yml ${TEMPDIR}/repo/${LS_REPO}/ || :
394
399
cd ${TEMPDIR}/repo/${LS_REPO}/
@@ -418,6 +423,19 @@ pipeline {
418
423
git add docs/images/docker-${CONTAINER_NAME}.md
419
424
echo "Updating docs repo"
420
425
git commit -m 'Bot Updating Documentation'
426
+ git mv docs/images/docker-${CONTAINER_NAME}.md docs/deprecated_images/docker-${CONTAINER_NAME}.md || :
427
+ if ! command -v yq || ! yq --help | grep -q 'mikefarah'; then
428
+ YQ_DL_VERSION=$(curl -fsX GET "https://api.github.com/repos/mikefarah/yq/releases/latest" | jq -r '. | .tag_name')
429
+ echo "No yq found, retrieving from upstream release version ${YQ_DL_VERSION}"
430
+ curl -fo /usr/local/bin/yq -L "https://github.com/mikefarah/yq/releases/download/${YQ_DL_VERSION}/yq_linux_amd64"
431
+ chmod +x /usr/local/bin/yq
432
+ fi
433
+ if ! yq -e '.plugins.[].redirects.redirect_maps.[] | select(. == "deprecated_images/docker-" + env(CONTAINER_NAME) + ".md")' mkdocs.yml >/dev/null 2>&1; then
434
+ echo "Updating mkdocs.yml with deprecation info"
435
+ yq -i '(.plugins.[] | select(.redirects)).redirects.redirect_maps |= . + {"images/docker-" + env(CONTAINER_NAME) + ".md" : "deprecated_images/docker-" + env(CONTAINER_NAME) + ".md"}' mkdocs.yml
436
+ git add mkdocs.yml
437
+ fi
438
+ git commit -m 'Bot Moving Deprecated Documentation' || :
421
439
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} --rebase
422
440
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} || \
423
441
(MAXWAIT="10" && echo "Push to docs failed, trying again in ${MAXWAIT} seconds" && \
@@ -439,6 +457,10 @@ pipeline {
439
457
echo "Updating Unraid template"
440
458
cd ${TEMPDIR}/unraid/templates/
441
459
GH_TEMPLATES_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||')
460
+ if ! grep -wq "^${CONTAINER_NAME}$" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
461
+ echo "${CONTAINER_NAME}" >> ${TEMPDIR}/unraid/templates/unraid/ignore.list
462
+ git add unraid/ignore.list
463
+ fi
442
464
if grep -wq "^${CONTAINER_NAME}$" ${TEMPDIR}/unraid/templates/unraid/ignore.list && [[ -f ${TEMPDIR}/unraid/templates/unraid/deprecated/${CONTAINER_NAME}.xml ]]; then
443
465
echo "Image is on the ignore list, and already in the deprecation folder."
444
466
elif grep -wq "^${CONTAINER_NAME}$" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
@@ -917,6 +939,7 @@ pipeline {
917
939
if [ -n "${SEMVER}" ]; then
918
940
docker buildx imagetools create --prefer-index=false -t ${PUSHIMAGE}:${SEMVER} ${CACHEIMAGE}:amd64-${COMMIT_SHA}-${BUILD_NUMBER}
919
941
fi
942
+ docker buildx imagetools create -t ${PUSHIMAGE}:latest ghcr.io/linuxserver/jenkins-builder:empty || true
920
943
done
921
944
'''
922
945
}
@@ -948,7 +971,7 @@ pipeline {
948
971
fi
949
972
done
950
973
for MANIFESTIMAGE in "${IMAGE}" "${GITLABIMAGE}" "${GITHUBIMAGE}" "${QUAYIMAGE}"; do
951
- docker buildx imagetools create -t ${MANIFESTIMAGE}:latest ${MANIFESTIMAGE}:amd64-latest ${MANIFESTIMAGE}:arm64v8-latest
974
+ docker buildx imagetools create -t ${MANIFESTIMAGE}:latest -t ${MANIFESTIMAGE}:amd64-latest -t ${MANIFESTIMAGE}:arm64v8-latest ghcr.io/linuxserver/jenkins-builder:empty || true
952
975
docker buildx imagetools create -t ${MANIFESTIMAGE}:${META_TAG} ${MANIFESTIMAGE}:amd64-${META_TAG} ${MANIFESTIMAGE}:arm64v8-${META_TAG}
953
976
954
977
docker buildx imagetools create -t ${MANIFESTIMAGE}:${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:amd64-${EXT_RELEASE_TAG} ${MANIFESTIMAGE}:arm64v8-${EXT_RELEASE_TAG}
@@ -1103,6 +1126,26 @@ EOF
1103
1126
1104
1127
}
1105
1128
}
1129
+ stage(' Deprecate/Disable Future Builds' ) {
1130
+ when {
1131
+ branch " master"
1132
+ environment name : ' CHANGE_ID' , value : ' '
1133
+ environment name : ' EXIT_STATUS' , value : ' '
1134
+ }
1135
+ steps {
1136
+ sh ''' #! /bin/bash
1137
+ TEMPDIR=$(mktemp -d)
1138
+ mkdir -p ${TEMPDIR}/repo
1139
+ git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
1140
+ cd ${TEMPDIR}/repo/${LS_REPO}
1141
+ git checkout -f master
1142
+ git rm Jenkinsfile
1143
+ git commit -m 'Disabling future builds'
1144
+ git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master
1145
+ git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git master
1146
+ rm -Rf ${TEMPDIR}'''
1147
+ }
1148
+ }
1106
1149
}
1107
1150
/* ######################
1108
1151
Send status to Discord
0 commit comments