@@ -61,7 +61,7 @@ pipeline {
61
61
env. CODE_URL = ' https://github.com/' + env. LS_USER + ' /' + env. LS_REPO + ' /commit/' + env. GIT_COMMIT
62
62
env. DOCKERHUB_LINK = ' https://hub.docker.com/r/' + env. DOCKERHUB_IMAGE + ' /tags/'
63
63
env. PULL_REQUEST = env. CHANGE_ID
64
- 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 '
64
+ 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 '
65
65
}
66
66
script{
67
67
env. LS_RELEASE_NUMBER = sh(
@@ -280,6 +280,7 @@ pipeline {
280
280
fi
281
281
# Stage 2 - Delete old templates
282
282
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"
283
+ 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)"
283
284
for i in ${OLD_TEMPLATES}; do
284
285
if [[ -f "${i}" ]]; then
285
286
TEMPLATES_TO_DELETE="${i} ${TEMPLATES_TO_DELETE}"
@@ -314,6 +315,14 @@ pipeline {
314
315
cd ${TEMPDIR}/docker-${CONTAINER_NAME}
315
316
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/workflows
316
317
mkdir -p ${TEMPDIR}/repo/${LS_REPO}/.github/ISSUE_TEMPLATE
318
+ if [[ -d "${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d" ]]; then
319
+ mkdir -p \
320
+ ${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d/init-deprecate/dependencies.d \
321
+ ${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d/init-services/dependencies.d \
322
+ ${TEMPDIR}/repo/${LS_REPO}/root/etc/s6-overlay/s6-rc.d/user/contents.d
323
+ else
324
+ mkdir -p ${TEMPDIR}/repo/${LS_REPO}/root/etc/cont-init.d
325
+ fi
317
326
cp --parents ${TEMPLATED_FILES} ${TEMPDIR}/repo/${LS_REPO}/ || :
318
327
cp --parents readme-vars.yml ${TEMPDIR}/repo/${LS_REPO}/ || :
319
328
cd ${TEMPDIR}/repo/${LS_REPO}/
@@ -347,6 +356,10 @@ pipeline {
347
356
fi
348
357
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
349
358
cd ${TEMPDIR}/unraid/templates/
359
+ if ! grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
360
+ echo "${CONTAINER_NAME}" >> ${TEMPDIR}/unraid/templates/unraid/ignore.list
361
+ git add unraid/ignore.list
362
+ fi
350
363
if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
351
364
echo "Image is on the ignore list, marking Unraid template as deprecated"
352
365
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
965
978
966
979
}
967
980
}
981
+ stage(' Deprecate/Disable Future Builds' ) {
982
+ when {
983
+ branch " master"
984
+ environment name : ' CHANGE_ID' , value : ' '
985
+ environment name : ' EXIT_STATUS' , value : ' '
986
+ }
987
+ steps {
988
+ sh ''' #! /bin/bash
989
+ TEMPDIR=$(mktemp -d)
990
+ mkdir -p ${TEMPDIR}/repo
991
+ git clone https://github.com/${LS_USER}/${LS_REPO}.git ${TEMPDIR}/repo/${LS_REPO}
992
+ cd ${TEMPDIR}/repo/${LS_REPO}
993
+ git checkout -f master
994
+ git rm Jenkinsfile
995
+ git commit -m 'Disabling future builds'
996
+ git push https://LinuxServer-CI:${GITHUB_TOKEN}@github.com/${LS_USER}/${LS_REPO}.git --all
997
+ rm -Rf ${TEMPDIR}'''
998
+ }
999
+ }
968
1000
}
969
1001
/* ######################
970
1002
Send status to Discord
0 commit comments