This repository has been archived on 2022-10-07. You can view files and clone it, but cannot push or open issues or pull requests.
skynet-webportal/scripts/portal-upgrade.sh

31 lines
813 B
Bash
Raw Permalink Normal View History

2020-09-14 15:40:18 +00:00
#!/bin/bash
set -e # exit on first error
2020-09-14 16:20:26 +00:00
# get current working directory (pwd doesn't cut it)
cwd=$(cd -P -- "$(dirname -- "$0")" && pwd -P)
2020-09-14 15:40:18 +00:00
# put the server down for maintenance
. ${cwd}/portal-down.sh
2021-02-01 20:29:30 +00:00
# build all container without cache
docker-compose build --no-cache --parallel --pull --quiet
2020-09-21 16:48:46 +00:00
# stop the docker services
2020-09-14 15:40:18 +00:00
docker-compose down
2020-09-21 16:48:46 +00:00
# clear unused docker containers so we don't run into out of disk space
# it should be done after the container have been stopped and before
# building them again
docker system prune --force
2020-09-24 09:13:50 +00:00
# prune all volumes to make sure there is no leftovers
# important for webapp container, otherwise html files will not be updated)
docker volume rm $(docker volume ls -q)
2020-09-21 16:48:46 +00:00
# start the docker services
2020-09-14 15:40:18 +00:00
docker-compose up -d
# enable the server again
. ${cwd}/portal-up.sh