Skip to content

Commit b0585d2

Browse files
Bot Updating Templated Files
1 parent 6a7d64e commit b0585d2

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

0 commit comments

Comments
 (0)