Skip to content

Commit

Permalink
Update: Move service updates AFTER infra updates
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Cameron <[email protected]>
  • Loading branch information
JasonLovesDoggo committed Sep 25, 2024
1 parent d19f8cf commit ced3746
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions dmoj/scripts/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,42 +49,8 @@ git stash
git pull
git stash pop

if ! ( has_param '-sd' "$@" || has_param '--skip-deploy' "$@"); then
# check if the user called the script with any specific service, if so update only that service
if [ "$1" != "" ] && [[ ! "$1" =~ ^- ]]; then # ignore the case where the user passes a flag as the first argument
echo "Updating only $1..."
docker service update --force wlmoj_"$1" --image ghcr.io/mcpt/wlmoj-"$1":latest
exit 0
else
echo "Updating all services..."
# Don't use docker stack deploy as that would also update the services that are not changed.
# texoid
docker service update --detach wlmoj_texoid --image ghcr.io/mcpt/wlmoj-texoid
# pdfoid
docker service update --detach wlmoj_pdfoid --image ghcr.io/mcpt/wlmoj-pdfoid
# mathoid
docker service update --detach wlmoj_mathoid --image ghcr.io/mcpt/wlmoj-mathoid
# site
docker service update --detach wlmoj_site --image ghcr.io/mcpt/wlmoj-site
# celery
docker service update --detach wlmoj_celery --image ghcr.io/mcpt/wlmoj-celery
# bridged
docker service update --detach wlmoj_bridged --image ghcr.io/mcpt/wlmoj-bridged
# wsevent
docker service update --detach wlmoj_wsevent --image ghcr.io/mcpt/wlmoj-wsevent
# backups
docker service update --detach wlmoj_backups --image ghcr.io/mcpt/wlmoj-backups

# Don't update nginx automatically, as it will cause downtime. Update it manually. via passing the nginx flag to this script.
fi
fi

cp /home/judge/docker/local_settings.py /var/share/configs/wlmoj/local_settings.py


echo "Done updating services."


# --------- Static files update ---------

function update_static() {
Expand Down Expand Up @@ -135,4 +101,38 @@ if ! (has_param '-ss' "$@" || has_param '--skip-static' "$@"); then

fi

fi
fi


if ! ( has_param '-sd' "$@" || has_param '--skip-deploy' "$@"); then
# check if the user called the script with any specific service, if so update only that service
if [ "$1" != "" ] && [[ ! "$1" =~ ^- ]]; then # ignore the case where the user passes a flag as the first argument
echo "Updating only $1..."
docker service update --force wlmoj_"$1" --image ghcr.io/mcpt/wlmoj-"$1":latest
exit 0
else
echo "Updating all services..."
# Don't use docker stack deploy as that would also update the services that are not changed.
# texoid
docker service update --detach wlmoj_texoid --image ghcr.io/mcpt/wlmoj-texoid
# pdfoid
docker service update --detach wlmoj_pdfoid --image ghcr.io/mcpt/wlmoj-pdfoid
# mathoid
docker service update --detach wlmoj_mathoid --image ghcr.io/mcpt/wlmoj-mathoid
# site
docker service update --detach wlmoj_site --image ghcr.io/mcpt/wlmoj-site
# celery
docker service update --detach wlmoj_celery --image ghcr.io/mcpt/wlmoj-celery
# bridged
docker service update --detach wlmoj_bridged --image ghcr.io/mcpt/wlmoj-bridged
# wsevent
docker service update --detach wlmoj_wsevent --image ghcr.io/mcpt/wlmoj-wsevent
# backups
docker service update --detach wlmoj_backups --image ghcr.io/mcpt/wlmoj-backups

# Don't update nginx automatically, as it will cause downtime. Update it manually. via passing the nginx flag to this script.
fi
fi


echo "Done updating services."

0 comments on commit ced3746

Please sign in to comment.