@@ -68,7 +68,7 @@ pipeline {
68
68
env. CODE_URL = ' https://github.com/' + env. LS_USER + ' /' + env. LS_REPO + ' /commit/' + env. GIT_COMMIT
69
69
env. DOCKERHUB_LINK = ' https://hub.docker.com/r/' + env. DOCKERHUB_IMAGE + ' /tags/'
70
70
env. PULL_REQUEST = env. CHANGE_ID
71
- 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 ./.github/workflows/package_trigger.yml ./root/donate.txt '
71
+ 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/donate.txt ./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 '
72
72
}
73
73
sh ''' #! /bin/bash
74
74
echo "The default github branch detected as ${GH_DEFAULT_BRANCH}" '''
@@ -306,6 +306,7 @@ pipeline {
306
306
fi
307
307
echo "Starting Stage 2 - Delete old templates"
308
308
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 Dockerfile.armhf"
309
+ OLD_TEMPLATES="${OLD_TEMPLATES} $(echo .github/workflows/{external_trigger,external_trigger_scheduler,package_trigger,package_trigger_scheduler,call_issue_pr_tracker,call_issues_cron}.yml)"
309
310
for i in ${OLD_TEMPLATES}; do
310
311
if [[ -f "${i}" ]]; then
311
312
TEMPLATES_TO_DELETE="${i} ${TEMPLATES_TO_DELETE}"
@@ -341,6 +342,10 @@ pipeline {
341
342
cd ${TEMPDIR}/docker-${CONTAINER_NAME}
342
343
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows
343
344
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE
345
+ mkdir -p \
346
+ ${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d/init-deprecate/dependencies.d \
347
+ ${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d/init-services/dependencies.d \
348
+ ${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d/user/contents.d
344
349
cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/ || :
345
350
cp --parents readme-vars.yml ${TEMPDIR}/repo/${LS_REPO}/ || :
346
351
cd ${TEMPDIR}/repo/${LS_REPO}/
@@ -370,6 +375,19 @@ pipeline {
370
375
git add docs/images/docker-${CONTAINER_NAME}.md
371
376
echo "Updating docs repo"
372
377
git commit -m 'Bot Updating Documentation'
378
+ git mv docs/images/docker-${CONTAINER_NAME}.md docs/deprecated_images/docker-${CONTAINER_NAME}.md || :
379
+ if ! command -v yq || ! yq --help | grep -q 'mikefarah'; then
380
+ YQ_DL_VERSION=$(curl -fsX GET "https://api.github.com/repos/mikefarah/yq/releases/latest" | jq -r '. | .tag_name')
381
+ echo "No yq found, retrieving from upstream release version ${YQ_DL_VERSION}"
382
+ curl -fo /usr/local/bin/yq -L "https://github.com/mikefarah/yq/releases/download/${YQ_DL_VERSION}/yq_linux_amd64"
383
+ chmod +x /usr/local/bin/yq
384
+ fi
385
+ if ! yq -e '.plugins.[].redirects.redirect_maps.[] | select(. == "deprecated/" + env(CONTAINER_NAME) + ".md")' mkdocs.yml >/dev/null 2>&1; then
386
+ echo "Updating mkdocs.yml with deprecation info"
387
+ yq -i '(.plugins.[] | select(.redirects)).redirects.redirect_maps |= . + {env(CONTAINER_NAME) + ".md" : "deprecated/" + env(CONTAINER_NAME) + ".md"}' mkdocs.yml
388
+ git add mkdocs.yml
389
+ fi
390
+ git commit -m 'Bot Moving Deprecated Documentation' || :
373
391
git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} --rebase
374
392
git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/linuxserver/docker-documentation.git ${GH_DOCS_DEFAULT_BRANCH} || \
375
393
(MAXWAIT="10" && echo "Push to docs failed, trying again in ${MAXWAIT} seconds" && \
@@ -391,6 +409,10 @@ pipeline {
391
409
echo "Updating Unraid template"
392
410
cd ${TEMPDIR}/unraid/templates/
393
411
GH_TEMPLATES_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||')
412
+ if ! grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
413
+ echo "${CONTAINER_NAME}" >> ${TEMPDIR}/unraid/templates/unraid/ignore.list
414
+ git add unraid/ignore.list
415
+ fi
394
416
if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
395
417
echo "Image is on the ignore list, marking Unraid template as deprecated"
396
418
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
@@ -1002,6 +1024,26 @@ EOF
1002
1024
1003
1025
}
1004
1026
}
1027
+ stage(' Deprecate/Disable Future Builds' ) {
1028
+ when {
1029
+ branch " develop"
1030
+ environment name : ' CHANGE_ID' , value : ' '
1031
+ environment name : ' EXIT_STATUS' , value : ' '
1032
+ }
1033
+ steps {
1034
+ sh ''' #! /bin/bash
1035
+ TEMPDIR=$(mktemp -d)
1036
+ mkdir -p ${TEMPDIR}/repo
1037
+ git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
1038
+ cd ${TEMPDIR}/repo/${LS_REPO}
1039
+ git checkout -f develop
1040
+ git rm Jenkinsfile
1041
+ git commit -m 'Disabling future builds'
1042
+ git pull https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git develop
1043
+ git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git develop
1044
+ rm -Rf ${TEMPDIR}'''
1045
+ }
1046
+ }
1005
1047
}
1006
1048
/* ######################
1007
1049
Send status to Discord
0 commit comments