Skip to content

Commit fdac5eb

Browse files
Bot Updating Templated Files
1 parent 180f6b9 commit fdac5eb

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

Jenkinsfile

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -385,16 +385,14 @@ pipeline {
385385
echo "Updating Unraid template"
386386
cd ${TEMPDIR}/unraid/templates/
387387
GH_TEMPLATES_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||')
388-
if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
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
388+
if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list && [[ -f ${TEMPDIR}/unraid/templates/unraid/deprecated/${CONTAINER_NAME}.xml ]]; then
389+
echo "Image is on the ignore list, and already in the deprecation folder."
390+
elif grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
391+
echo "Image is on the ignore list, marking Unraid template as deprecated"
392+
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
393+
git add -u unraid/${CONTAINER_NAME}.xml
394+
git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || :
395+
git commit -m 'Bot Moving Deprecated Unraid Template' || :
398396
else
399397
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
400398
git add unraid/${CONTAINER_NAME}.xml

0 commit comments

Comments
 (0)