@@ -64,7 +64,7 @@ pipeline {
64
64
env. CODE_URL = ' https://github.com/' + env. LS_USER + ' /' + env. LS_REPO + ' /commit/' + env. GIT_COMMIT
65
65
env. DOCKERHUB_LINK = ' https://hub.docker.com/r/' + env. DOCKERHUB_IMAGE + ' /tags/'
66
66
env. PULL_REQUEST = env. CHANGE_ID
67
- 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 '
67
+ 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/cont-init.d/99-deprecation '
68
68
}
69
69
script{
70
70
env. LS_RELEASE_NUMBER = sh(
@@ -290,6 +290,7 @@ pipeline {
290
290
fi
291
291
# Stage 2 - Delete old templates
292
292
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"
293
+ 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)"
293
294
for i in ${OLD_TEMPLATES}; do
294
295
if [[ -f "${i}" ]]; then
295
296
TEMPLATES_TO_DELETE="${i} ${TEMPLATES_TO_DELETE}"
@@ -324,6 +325,14 @@ pipeline {
324
325
cd ${TEMPDIR}/docker-${CONTAINER_NAME}
325
326
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows
326
327
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE
328
+ if [[ -d "${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d" ]]; then
329
+ mkdir -p \
330
+ ${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d/init-deprecate/dependencies.d \
331
+ ${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d/init-services/dependencies.d \
332
+ ${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d/user/contents.d
333
+ else
334
+ mkdir -p ${TEMPDIR}/repo/${LS_REPO}/root/etc/cont-init.d
335
+ fi
327
336
cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/ || :
328
337
cp --parents readme-vars.yml ${TEMPDIR}/repo/${LS_REPO}/ || :
329
338
cd ${TEMPDIR}/repo/${LS_REPO}/
@@ -357,6 +366,10 @@ pipeline {
357
366
fi
358
367
if [[ ("${BRANCH_NAME}" == "master") || ("${BRANCH_NAME}" == "main") ]] && [[ (! -f ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml) || ("$(md5sum ${TEMPDIR}/unraid/templates/unraid/${CONTAINER_NAME}.xml | awk '{ print $1 }')" != "$(md5sum ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml | awk '{ print $1 }')") ]]; then
359
368
cd ${TEMPDIR}/unraid/templates/
369
+ if ! grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
370
+ echo "${CONTAINER_NAME}" >> ${TEMPDIR}/unraid/templates/unraid/ignore.list
371
+ git add unraid/ignore.list
372
+ fi
360
373
if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
361
374
echo "Image is on the ignore list, marking Unraid template as deprecated"
362
375
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
975
988
976
989
}
977
990
}
991
+ stage(' Deprecate/Disable Future Builds' ) {
992
+ when {
993
+ branch " master"
994
+ environment name : ' CHANGE_ID' , value : ' '
995
+ environment name : ' EXIT_STATUS' , value : ' '
996
+ }
997
+ steps {
998
+ sh ''' #! /bin/bash
999
+ TEMPDIR=$(mktemp -d)
1000
+ mkdir -p ${TEMPDIR}/repo
1001
+ git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
1002
+ cd ${TEMPDIR}/repo/${LS_REPO}
1003
+ git checkout -f master
1004
+ git rm Jenkinsfile
1005
+ git commit -m 'Disabling future builds'
1006
+ git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
1007
+ rm -Rf ${TEMPDIR}'''
1008
+ }
1009
+ }
978
1010
}
979
1011
/* ######################
980
1012
Send status to Discord
0 commit comments