Skip to content

Commit bd9f41e

Browse files
Bot Updating Templated Files
1 parent 4864ce1 commit bd9f41e

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

Diff for: Jenkinsfile

+8-10
Original file line numberDiff line numberDiff line change
@@ -391,16 +391,14 @@ pipeline {
391391
echo "Updating Unraid template"
392392
cd ${TEMPDIR}/unraid/templates/
393393
GH_TEMPLATES_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||')
394-
if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
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
394+
if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list && [[ -f ${TEMPDIR}/unraid/templates/unraid/deprecated/${CONTAINER_NAME}.xml ]]; then
395+
echo "Image is on the ignore list, and already in the deprecation folder."
396+
elif grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then
397+
echo "Image is on the ignore list, marking Unraid template as deprecated"
398+
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
399+
git add -u unraid/${CONTAINER_NAME}.xml
400+
git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || :
401+
git commit -m 'Bot Moving Deprecated Unraid Template' || :
404402
else
405403
cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/
406404
git add unraid/${CONTAINER_NAME}.xml

0 commit comments

Comments
 (0)