File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44# The argument should contain the container name to run as the first argument (e.g. web-ui-tests)
55# Once the container finishes its task, this script shuts down the docker containers
66# because docker compose run starts dependent containers, but does not stop them
7-
87pushd " $( dirname " $0 " ) " # Set pwd to this directory
9- docker compose run --service-ports --build --rm " $@ " # Passes all arguments to the compose file
10- exit_code=$?
11- docker compose down
8+
9+ if [[ " ${CI} " == " 1" || " ${CI} " == " true" ]]; then
10+ # In CI, keep the container in case we need to dump logs in another
11+ # step of the GH action. It should be cleaned up automatically by the CI runner.
12+ docker compose run --service-ports --build -e CI=true " $@ "
13+ exit_code=$?
14+ docker compose stop
15+ else
16+ docker compose run --service-ports --rm --build " $@ "
17+ exit_code=$?
18+ docker compose down
19+ fi
20+
1221popd # Reset pwd
1322exit $exit_code
You can’t perform that action at this time.
0 commit comments