Skip to content

Commit

Permalink
fix: e2e - docker logs fix (#2032)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bmingles committed May 24, 2024
1 parent 95ec12b commit 297ad9a
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions tests/docker-scripts/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@
# The argument should contain the container name to run as the first argument (e.g. web-ui-tests)
# Once the container finishes its task, this script shuts down the docker containers
# because docker compose run starts dependent containers, but does not stop them

pushd "$(dirname "$0")" # Set pwd to this directory
docker compose run --service-ports --build --rm "$@" # Passes all arguments to the compose file
exit_code=$?
docker compose down

if [[ "${CI}" == "1" || "${CI}" == "true" ]]; then
# In CI, keep the container in case we need to dump logs in another
# step of the GH action. It should be cleaned up automatically by the CI runner.
docker compose run --service-ports --build -e CI=true "$@"
exit_code=$?
docker compose stop
else
docker compose run --service-ports --rm --build "$@"
exit_code=$?
docker compose down
fi

popd # Reset pwd
exit $exit_code

0 comments on commit 297ad9a

Please sign in to comment.