From 5627fa68f6c43e4a6ff0f37be1b66a2bcf7d27a1 Mon Sep 17 00:00:00 2001 From: Martin B Date: Fri, 27 Oct 2023 12:55:39 +0100 Subject: [PATCH] Don't fail deploys catastrophically (#3438) * Update deploy.sh * fix if statement syntax * Update scripts/deploy.sh Co-authored-by: Rikard Blixt * Update deploy.sh --------- Co-authored-by: Rikard Blixt --- scripts/deploy.sh | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 4027edbcef8..a50665de94f 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -20,8 +20,8 @@ else gitDeployReason='Automated Weekly Re-Sync' fi -for luaFile in $luaFiles -do +allModulesDeployed=true +for luaFile in $luaFiles; do if [[ -n "$1" ]]; then luaFile="./$luaFile" fi @@ -30,8 +30,7 @@ do [[ $fileContents =~ $pat ]] - if [[ "${BASH_REMATCH[1]}" == "" ]] - then + if [[ "${BASH_REMATCH[1]}" == "" ]]; then echo '...skipping - no magic comment found' else wiki="${BASH_REMATCH[1]}" @@ -49,8 +48,7 @@ do wikiApiUrl="${WIKI_BASE_URL}/${wiki}/api.php" ckf="cookie_${wiki}.ck" - if [[ ${loggedin[${wiki}]} != 1 ]] - then + if [[ ${loggedin[${wiki}]} != 1 ]]; then # Login echo "...logging in on \"${wiki}\"" loginToken=$( @@ -120,14 +118,20 @@ do echo "DEBUG: ...${rawResult}" if [[ "${result}" == "Success" ]]; then echo "...${result}" + echo '...done' else - exit 1 + echo "...failed to deploy" + allModulesDeployed=false fi - echo '...done' # Don't get rate limited sleep 4 fi + + if [ "$allModulesDeployed" != true ]; then + echo "DEBUG: Some modules were not deployed!" + exit 1 + fi done rm -f cookie_*