diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..cef5ae5 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +var/ \ No newline at end of file diff --git a/bin/script/foreachSystem b/bin/script/foreachSystem index 2cbff86..4bc4f98 100755 --- a/bin/script/foreachSystem +++ b/bin/script/foreachSystem @@ -22,6 +22,8 @@ for SYSTEM in $ENV_DIR/systems/*/*/ ; do if [[ "$COMMAND" == "init" ]]; then $ENV_DIR/systems/$typePart/$systemPart/bin/script/init + elif [[ "$COMMAND" == "update" ]]; then + $ENV_DIR/systems/$typePart/$systemPart/bin/script/update else $DENV_COMMAND $SYSTEM_CODE $COMMAND fi diff --git a/update b/update new file mode 100755 index 0000000..c0193e6 --- /dev/null +++ b/update @@ -0,0 +1,33 @@ +#!/bin/bash + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +source $SCRIPT_DIR/bin/denv +source $SCRIPT_DIR/bin/dexec +source $SCRIPT_DIR/bin/drun + +EXIT=0 + +# Check docker-compose.yml file +if [ ! -f "$SCRIPT_DIR/docker/docker-compose.yml" ] +then + cp "$SCRIPT_DIR/docker/docker-compose.yml.dist" "$SCRIPT_DIR/docker/docker-compose.yml" + EXIT=1 +fi + +# Check docker-compose-mac.yml file +if [ ! -f "$SCRIPT_DIR/docker/docker-compose-mac.yml" ] +then + cp "$SCRIPT_DIR/docker/docker-compose-mac.yml.dist" "$SCRIPT_DIR/docker/docker-compose-mac.yml" + EXIT=1 +fi + + +if [ $EXIT -eq 1 ] +then + echo "docker-compose files created, please change variables and call update again" + exit 1 +fi + +denvexec up -d +$SCRIPT_DIR/bin/script/foreachSystem update