Skip to content

Commit

Permalink
Don't fail deploys catastrophically (#3438)
Browse files Browse the repository at this point in the history
* Update deploy.sh

* fix if statement syntax

* Update scripts/deploy.sh

Co-authored-by: Rikard Blixt <[email protected]>

* Update deploy.sh

---------

Co-authored-by: Rikard Blixt <[email protected]>
  • Loading branch information
iMarbot and Rathoz authored Oct 27, 2023
1 parent a626e4a commit 5627fa6
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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]}"
Expand All @@ -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=$(
Expand Down Expand Up @@ -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_*

0 comments on commit 5627fa6

Please sign in to comment.