diff options
author | 2024-05-12 09:43:31 +0000 | |
---|---|---|
committer | 2024-05-12 09:43:31 +0000 | |
commit | e059ec96ac7feba54b1899521450bf28e74d7423 (patch) | |
tree | 6dc4766f4bd6b85cb019bad6f3d560020a367617 | |
parent | 3743fe8aec56c5099af0ff5691b9176439ca9080 (diff) | |
download | docker-nzbhydra2-e059ec96ac7feba54b1899521450bf28e74d7423.tar.gz docker-nzbhydra2-e059ec96ac7feba54b1899521450bf28e74d7423.tar.zst docker-nzbhydra2-e059ec96ac7feba54b1899521450bf28e74d7423.zip |
Bot Updating Templated Files
-rw-r--r-- | Jenkinsfile | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/Jenkinsfile b/Jenkinsfile index 0603bc6..f7ea6e1 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -391,16 +391,14 @@ pipeline { echo "Updating Unraid template" cd ${TEMPDIR}/unraid/templates/ GH_TEMPLATES_DEFAULT_BRANCH=$(git remote show origin | grep "HEAD branch:" | sed 's|.*HEAD branch: ||') - if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then - if [[ -f ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ]]; then - echo "Image is on the ignore list, marking Unraid template as deprecated" - cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/ - git add -u unraid/${CONTAINER_NAME}.xml - git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || : - git commit -m 'Bot Moving Deprecated Unraid Template' || : - else - echo "Image is on the ignore list, but no template exist, skipping deprecation" - fi + if grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list && [[ -f ${TEMPDIR}/unraid/templates/unraid/deprecated/${CONTAINER_NAME}.xml ]]; then + echo "Image is on the ignore list, and already in the deprecation folder." + elif grep -wq "${CONTAINER_NAME}" ${TEMPDIR}/unraid/templates/unraid/ignore.list; then + echo "Image is on the ignore list, marking Unraid template as deprecated" + cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/ + git add -u unraid/${CONTAINER_NAME}.xml + git mv unraid/${CONTAINER_NAME}.xml unraid/deprecated/${CONTAINER_NAME}.xml || : + git commit -m 'Bot Moving Deprecated Unraid Template' || : else cp ${TEMPDIR}/docker-${CONTAINER_NAME}/.jenkins-external/${CONTAINER_NAME}.xml ${TEMPDIR}/unraid/templates/unraid/ git add unraid/${CONTAINER_NAME}.xml |