Merge remote-tracking branch 'origin/master' into accounts

This commit is contained in:
Karol Wypchlo 2021-01-21 12:31:09 +01:00
commit 4ae61e2364
3 changed files with 33 additions and 2 deletions

View File

@ -2,6 +2,16 @@
set -e # exit on first error set -e # exit on first error
while getopts d:t: flag
do
case "${flag}" in
d) delay=${OPTARG};;
t) timeout=${OPTARG};;
esac
done
delay=${delay:-0} # default to no delay
timeout=${timeout:-300} # default timeout is 300s
countdown() { countdown() {
local secs=$1 local secs=$1
while [ $secs -gt 0 ]; do while [ $secs -gt 0 ]; do
@ -11,8 +21,11 @@ countdown() {
done done
} }
# delay disabling the portal
countdown $delay
# stop healh-check so the server is taken our of load balancer # stop healh-check so the server is taken our of load balancer
docker exec health-check cli/disable docker exec health-check cli/disable
# then wait 5 minutes for the load balancer to propagate the dns records # then wait 5 minutes for the load balancer to propagate the dns records
countdown 300 countdown $timeout

18
scripts/portal-restart.sh Normal file
View File

@ -0,0 +1,18 @@
#!/bin/bash
set -e # exit on first error
# get current working directory (pwd doesn't cut it)
cwd=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
# put the server down for maintenance
. ${cwd}/portal-down.sh
# stop the docker services
docker-compose down
# start the docker services
docker-compose up -d
# enable the server again
. ${cwd}/portal-up.sh

View File

@ -21,7 +21,7 @@ docker system prune --force
docker volume rm $(docker volume ls -q) docker volume rm $(docker volume ls -q)
# build all container without cache # build all container without cache
docker-compose build --no-cache docker-compose build --no-cache --parallel --pull --quiet
# start the docker services # start the docker services
docker-compose up -d docker-compose up -d