Skip to content

Commit d29b22e

Browse files
Bot Updating Templated Files
1 parent 7229414 commit d29b22e

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
@@ -381,16 +381,14 @@ pipeline {
381381
echo "Updating Unraid template"
382382
cd ${TEMPDIR}/unraid/templates/
383383
GH_TEMPLATES_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||')
384-
if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
385-
if [[ -f ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ]]; then
386-
echo "Image is on the ignore list, marking Unraid template as deprecated"
387-
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
388-
git add -u unraid/${CONTAINER_NAME}.xml
389-
git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || :
390-
git commit -m 'Bot Moving Deprecated Unraid Template' || :
391-
else
392-
echo "Image is on the ignore list, but no template exist, skipping deprecation"
393-
fi
384+
if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list && [[ -f ${TEMPDIR}/unraid/templates/unraid/deprecated/${CONTAINER_NAME}.xml ]]; then
385+
echo "Image is on the ignore list, and already in the deprecation folder."
386+
elif grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
387+
echo "Image is on the ignore list, marking Unraid template as deprecated"
388+
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
389+
git add -u unraid/${CONTAINER_NAME}.xml
390+
git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || :
391+
git commit -m 'Bot Moving Deprecated Unraid Template' || :
394392
else
395393
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
396394
git add unraid/${CONTAINER_NAME}.xml

0 commit comments

Comments
 (0)