Merge remote-tracking branch 'origin/master' into accounts
This commit is contained in:
commit
4ae61e2364
|
@ -2,6 +2,16 @@
|
|||
|
||||
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() {
|
||||
local secs=$1
|
||||
while [ $secs -gt 0 ]; do
|
||||
|
@ -11,8 +21,11 @@ countdown() {
|
|||
done
|
||||
}
|
||||
|
||||
# delay disabling the portal
|
||||
countdown $delay
|
||||
|
||||
# stop healh-check so the server is taken our of load balancer
|
||||
docker exec health-check cli/disable
|
||||
|
||||
# then wait 5 minutes for the load balancer to propagate the dns records
|
||||
countdown 300
|
||||
countdown $timeout
|
||||
|
|
|
@ -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
|
|
@ -21,7 +21,7 @@ docker system prune --force
|
|||
docker volume rm $(docker volume ls -q)
|
||||
|
||||
# build all container without cache
|
||||
docker-compose build --no-cache
|
||||
docker-compose build --no-cache --parallel --pull --quiet
|
||||
|
||||
# start the docker services
|
||||
docker-compose up -d
|
||||
|
|
Reference in New Issue