-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
15 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,34 @@ | ||
#!/bin/bash | ||
|
||
ENV_FILE="./.env" | ||
DOCKER_COMPOSE_FILE="-f ./docker-compose.yml -f ./docker-compose.override.setup.yml" | ||
# optionally set env file and docker compose file from arguments | ||
ENV_FILE=${1:-"./.env"} | ||
DOCKER_COMPOSE_FILE=${2:-"./docker-compose.yml -f ./docker-compose.override.setup.yml"} | ||
|
||
. "$(dirname "$0")"/_select_docker_compose.sh | ||
. "$(dirname "$0")"/_load_dot_env.sh $ENV_FILE | ||
|
||
echo "Using docker compose file at: $DOCKER_COMPOSE_FILE" | ||
|
||
# stop system | ||
$DOCKER_COMPOSE $DOCKER_COMPOSE_FILE --env-file $ENV_FILE --profile=manual_dev down | ||
# stop system before setup | ||
$DOCKER_COMPOSE -f $DOCKER_COMPOSE_FILE --env-file $ENV_FILE --profile=manual_dev down | ||
|
||
# add postgres user with privileges | ||
$DOCKER_COMPOSE $DOCKER_COMPOSE_FILE --env-file $ENV_FILE up --wait orchestrator_postgres_db | ||
$DOCKER_COMPOSE $DOCKER_COMPOSE_FILE exec orchestrator_postgres_db psql \ | ||
$DOCKER_COMPOSE -f $DOCKER_COMPOSE_FILE --env-file $ENV_FILE up --wait orchestrator_postgres_db | ||
$DOCKER_COMPOSE -f $DOCKER_COMPOSE_FILE exec orchestrator_postgres_db psql \ | ||
-d postgres \ | ||
-v PG_USERNAME="$POSTGRES_ORCHESTRATOR_USER_NAME" \ | ||
-v PG_PASSWORD="$POSTGRES_ORCHESTRATOR_USER_PASSWORD" \ | ||
-v PG_DB=postgres \ | ||
-f /setup/init.sql | ||
|
||
# add rabbitmq 'omotes' and 'celery' vhosts and users | ||
$DOCKER_COMPOSE $DOCKER_COMPOSE_FILE up --wait rabbitmq | ||
$DOCKER_COMPOSE $DOCKER_COMPOSE_FILE exec rabbitmq /bin/sh -c "./setup/rabbitmq-init.sh" | ||
$DOCKER_COMPOSE -f $DOCKER_COMPOSE_FILE up --wait rabbitmq | ||
$DOCKER_COMPOSE -f $DOCKER_COMPOSE_FILE exec rabbitmq /bin/sh -c "./setup/rabbitmq-init.sh" | ||
|
||
# add influxdb users with write access for optimizer/simulator and with admin rights | ||
# for the frontend (root admin user via env vars) | ||
$DOCKER_COMPOSE $DOCKER_COMPOSE_FILE up --wait omotes_influxdb | ||
$DOCKER_COMPOSE $DOCKER_COMPOSE_FILE exec omotes_influxdb /bin/sh -c "./setup/influxdb-init.sh" | ||
$DOCKER_COMPOSE -f $DOCKER_COMPOSE_FILE up --wait omotes_influxdb | ||
$DOCKER_COMPOSE -f $DOCKER_COMPOSE_FILE exec omotes_influxdb /bin/sh -c "./setup/influxdb-init.sh" | ||
|
||
# stop system after setup | ||
$DOCKER_COMPOSE -f $DOCKER_COMPOSE_FILE --env-file $ENV_FILE down |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters