Skip to content

Commit d9dc9a8

Browse files
Bot Updating Templated Files
1 parent eb81983 commit d9dc9a8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Jenkinsfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -386,11 +386,15 @@ pipeline {
386386
cd ${TEMPDIR}/unraid/templates/
387387
GH_TEMPLATES_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||')
388388
if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
389-
echo "Image is on the ignore list, marking Unraid template as deprecated"
390-
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
391-
git add -u unraid/${CONTAINER_NAME}.xml
392-
git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || :
393-
git commit -m 'Bot Moving Deprecated Unraid Template' || :
389+
if [[ -f ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ]]; then
390+
echo "Image is on the ignore list, marking Unraid template as deprecated"
391+
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
392+
git add -u unraid/${CONTAINER_NAME}.xml
393+
git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || :
394+
git commit -m 'Bot Moving Deprecated Unraid Template' || :
395+
else
396+
echo "Image is on the ignore list, but no template exist, skipping deprecation"
397+
fi
394398
else
395399
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
396400
git add unraid/${CONTAINER_NAME}.xml

0 commit comments

Comments
 (0)