Skip to content

Commit 297ad9a

Browse files
authored
fix: e2e - docker logs fix (#2032)
There was an issue where containers were removed before the docker logs step. Containers are now kept around until GH actions are done fixes #2031
1 parent 95ec12b commit 297ad9a

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

tests/docker-scripts/run.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,19 @@
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-
87
pushd "$(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+
1221
popd # Reset pwd
1322
exit $exit_code

0 commit comments

Comments
 (0)