diff options
author | adheli.tavares <adheli.tavares@est.tech> | 2024-08-15 12:39:19 +0100 |
---|---|---|
committer | Adheli Tavares <adheli.tavares@est.tech> | 2024-08-26 08:21:39 +0000 |
commit | d802fd9a6c6aaffa330a30b68f7896ffebaa4fcd (patch) | |
tree | 823eb915f6322a38477d971273a0e43713ce0d06 /compose/start-compose.sh | |
parent | 10cf66cdd2cca12dad9f299714e6294ae35752a7 (diff) |
Change default database to PostgreSQL
Issue-ID: POLICY-5118
Change-Id: I22ece93aca3cbc5e406e4942ce5255a7b7b60761
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
Diffstat (limited to 'compose/start-compose.sh')
-rwxr-xr-x | compose/start-compose.sh | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/compose/start-compose.sh b/compose/start-compose.sh index 671927ba..013aba6f 100755 --- a/compose/start-compose.sh +++ b/compose/start-compose.sh @@ -20,8 +20,9 @@ #Usage: $0 [policy-component] [OPTIONS]" #" OPTIONS:" -#" --grafana start the docker compose with grafana" -#" --gui start the docker compose with gui" +#" --grafana start the docker compose with grafana" +#" --mariadb start the docker compose using mariadb" +#" --postgres [default] start the docker compose using postgres db" #" no policy-component will start all components" if [ -z "${WORKSPACE}" ]; then @@ -32,6 +33,7 @@ COMPOSE_FOLDER="${WORKSPACE}"/compose # Set default values for the options grafana=false +database=postgres # Parse the command-line arguments while [[ $# -gt 0 ]] @@ -43,6 +45,14 @@ do grafana=true shift ;; + --mariadb) + database=mariadb + shift + ;; + --postgres) + database=postgres + shift + ;; *) component="$1" shift @@ -61,30 +71,23 @@ if [ -z "$PROJECT" ]; then export PROJECT=$component fi -# docker compose fails when not running CSIT -if [ -z "$ROBOT_LOG_DIR" ]; then - export ROBOT_LOG_DIR=/tmp/ -fi - -# always 'docker' if running docker compose -export TEST_ENV="docker" +export database if [ -n "$component" ]; then - if [ "$component" == "logs" ]; then - echo "Collecting logs..." - docker compose logs > docker-compose.log - elif [ "$grafana" = true ]; then - echo "Starting ${component} application with Grafana" - docker compose up -d "${component}" grafana + if [ "$grafana" = true ]; then + echo "Starting ${component} using ${database} + Grafana/Prometheus" + docker compose up -d ${component} ${database} grafana + echo "Prometheus server: http://localhost:${PROMETHEUS_PORT}" echo "Grafana server: http://localhost:${GRAFANA_PORT}" + else - echo "Starting ${component} application" - docker compose up -d "${component}" + echo "Starting ${component} using ${database}" + docker compose up -d ${component} ${database} fi else export PROJECT=api # api has groups.json complete with all 3 pdps - echo "Starting all components..." + echo "Starting all components using ${database}" docker compose up -d fi |