wisski-cloud-distillery/distillery/system_update.sh
Tom Wiesing 76ef5d8e68
Switch to using Docker
This commit refactors all code in this project to make use of docker.
This has not yet been documented properly.
2020-06-26 12:54:47 +02:00

31 lines
No EOL
790 B
Bash

#!/bin/bash
set -e
# read the lib/shared.sh
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$DIR"
source "$DIR/lib/lib.sh"
# update_stack fully updates a docker-compose stack in the given location.
function update_stack() {
cd "$1"
docker-compose pull
docker-compose build --pull
docker-compose up -d
}
log_info "=> Rebuilding and restarting 'web' stack"
update_stack "$COMPOSER_WEB_DIR"
# build and start the triplestore
log_info "=> Rebuilding and restarting 'triplestore' stack"
update_stack "$COMPOSER_TRIPLESTORE_DIR"
# build and start the triplestore
log_info "=> Rebuilding and restarting 'sql' stack"
update_stack "$COMPOSER_SQL_DIR"
# TODO: Iterate over all the instance
# and a pull_and_update
log_info "=> System up-to-date. "