Add rebuild-all.sh script

This commit adds a script called 'rebuild-all.sh' that automatically
rebuilds all instances.
This commit is contained in:
Tom Wiesing 2020-08-27 09:56:02 +02:00
parent 7cbfaf99d5
commit b6c75a848c
No known key found for this signature in database
GPG key ID: DC1F29F2BC78AB15
2 changed files with 21 additions and 1 deletions

View file

@ -170,7 +170,7 @@ To do so, use:
sudo bash /distillery/provision.sh SLUG sudo bash /distillery/provision.sh SLUG
``` ```
## Rebuild an instance -- 'rebuild.sh' ## Rebuild an instance -- 'rebuild.sh' and 'rebuild-all.sh'
Sometimes it becomes necessary (because of changes to this project) to rebuild the docker image running a certain docker instance. Sometimes it becomes necessary (because of changes to this project) to rebuild the docker image running a certain docker instance.
To do so, use: To do so, use:
@ -188,7 +188,11 @@ To delete all instances, run:
sudo docker image prune --all sudo docker image prune --all
``` ```
To automatically rebuild all instances, use:
```bash
sudo bash /distillery/rebuild-all.sh
```
## Purge an existing WissKI instance -- 'purge.sh' ## Purge an existing WissKI instance -- 'purge.sh'

16
distillery/rebuild-all.sh Executable file
View file

@ -0,0 +1,16 @@
#!/bin/bash
set -e
# read the lib/shared.sh and read the slug argument.
DISABLE_LOG=1
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$DIR"
source "$DIR/lib/lib.sh"
DISABLE_LOG=0
# update all the instances
for slug in $(sql_bookkeep_list); do
log_info "=> /bin/bash $DIR/rebuild.sh '$slug'"
/bin/bash "$DIR/rebuild.sh" "$slug";
done