Skip to content

Commit fd7b907

Browse files
Bot Updating Templated Files
1 parent 3b0a6de commit fd7b907

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

Jenkinsfile

+9-5
Original file line numberDiff line numberDiff line change
@@ -392,11 +392,15 @@ pipeline {
392392
cd ${TEMPDIR}/unraid/templates/
393393
GH_TEMPLATES_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||')
394394
if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
395-
echo "Image is on the ignore list, marking Unraid template as deprecated"
396-
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
397-
git add -u unraid/${CONTAINER_NAME}.xml
398-
git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || :
399-
git commit -m 'Bot Moving Deprecated Unraid Template' || :
395+
if [[ -f ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ]]; then
396+
echo "Image is on the ignore list, marking Unraid template as deprecated"
397+
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
398+
git add -u unraid/${CONTAINER_NAME}.xml
399+
git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || :
400+
git commit -m 'Bot Moving Deprecated Unraid Template' || :
401+
else
402+
echo "Image is on the ignore list, but no template exist, skipping deprecation"
403+
fi
400404
else
401405
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
402406
git add unraid/${CONTAINER_NAME}.xml

0 commit comments

Comments
 (0)