From 5980fb4d758c2ee55fad90661d039920dcc0ebe6 Mon Sep 17 00:00:00 2001 From: "adheli.tavares" Date: Thu, 16 Mar 2023 16:31:11 +0000 Subject: Improvements to scripts and test configuration - reduced csit image for k8s test from 1gb to 230mb - fixed some small hindrances with start-compose.sh - added README for how to use and configure compose script - cleaning of Chart.lock as it fails helm install if outdated even after running helm dependencies update Issue-ID: POLICY-4125 Change-Id: If1711523bb836c212f27a032a46cc18d68766478 Signed-off-by: adheli.tavares --- compose/start-compose.sh | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'compose/start-compose.sh') diff --git a/compose/start-compose.sh b/compose/start-compose.sh index a77b4834..49006f11 100755 --- a/compose/start-compose.sh +++ b/compose/start-compose.sh @@ -57,9 +57,11 @@ do esac done +cd ${COMPOSE_FOLDER} + echo "Configuring docker compose..." -source "${COMPOSE_FOLDER}"/export-ports.sh > /dev/null 2>&1 -source "${COMPOSE_FOLDER}"/get-versions.sh > /dev/null 2>&1 +source export-ports.sh > /dev/null 2>&1 +source get-versions.sh > /dev/null 2>&1 # in case of csit running for PAP (groups should be for pap) but starts apex-pdp for dependencies. if [ -z "$PROJECT" ]; then @@ -67,29 +69,32 @@ if [ -z "$PROJECT" ]; then fi if [ -n "$component" ]; then - if [ "$grafana" = true ]; 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 -f "${COMPOSE_FOLDER}"/docker-compose.yml up -d "${component}" grafana + docker-compose up -d "${component}" grafana echo "Prometheus server: http://localhost:${PROMETHEUS_PORT}" echo "Grafana server: http://localhost:${GRAFANA_PORT}" elif [ "$gui" = true ]; then echo "Starting application with gui..." - docker-compose -f "${COMPOSE_FOLDER}"/docker-compose.yml \ - -f "${COMPOSE_FOLDER}"/docker-compose.gui.yml up -d "${component}" policy-gui + docker-compose -f docker-compose.yml -f docker-compose.gui.yml up -d "${component}" policy-gui echo "Clamp GUI: https://localhost:2445/clamp" else echo "Starting ${component} application" - docker-compose -f "${COMPOSE_FOLDER}"/docker-compose.yml up -d "${component}" + docker-compose up -d "${component}" fi else export PROJECT=api # api has groups.json complete with all 3 pdps if [ "$gui" = true ]; then echo "Starting application with gui..." - docker-compose -f "${COMPOSE_FOLDER}"/docker-compose.yml \ - -f "${COMPOSE_FOLDER}"/docker-compose.gui.yml up -d + docker-compose -f docker-compose.yml -f docker-compose.gui.yml up -d echo "Clamp GUI: https://localhost:2445/clamp" else echo "Starting all components..." - docker-compose -f "${COMPOSE_FOLDER}"/docker-compose.yml up -d + docker-compose up -d fi fi + +cd ${WORKSPACE} -- cgit 1.2.3-korg