diff --git a/README.md b/README.md index 112304e..da4388a 100644 --- a/README.md +++ b/README.md @@ -170,7 +170,7 @@ To do so, use: 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. To do so, use: @@ -188,7 +188,11 @@ To delete all instances, run: 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' diff --git a/distillery/rebuild-all.sh b/distillery/rebuild-all.sh new file mode 100755 index 0000000..3ba3d35 --- /dev/null +++ b/distillery/rebuild-all.sh @@ -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 +