Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script: docker: remove docker images of the tested PR when cleaning #9952

Merged
merged 1 commit into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/cleanup-db.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ OSRD_VALKEY="osrd-valkey"
OSRD_VALKEY_VOLUME="osrd_valkey_data"
OSRD_POSTGRES_PORT=5432
OSRD_VALKEY_PORT=6379
if [ "$PR_TEST" -eq 1 ]; then
if [ "$PR_TEST" = 1 ]; then
OSRD_POSTGRES="osrd-postgres-pr-tests"
OSRD_EDITOAST="osrd-editoast-pr-tests"
OSRD_VALKEY="osrd-valkey-pr-tests"
Expand Down
2 changes: 1 addition & 1 deletion scripts/load-backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ fi
# These variables are necessary to load the infra on the correct instance (the pr-infra or the dev one)
OSRD_POSTGRES="osrd-postgres"
OSRD_POSTGRES_PORT=5432
if [ "$PR_TEST" -eq 1 ]; then
if [ "$PR_TEST" = 1 ]; then
OSRD_POSTGRES="osrd-postgres-pr-tests"
OSRD_POSTGRES_PORT=5433
fi
Expand Down
12 changes: 11 additions & 1 deletion scripts/pr-tests-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,20 @@ elif [ "$1" = "down" ]; then

else

# Shutdown and clean the docker instance
# Shutdown and clean the docker instance (remove "osrd" images too)
osrd_images=$(docker compose \
-p "osrd-pr-tests" \
-f "docker/docker-compose.pr-tests.yml" \
images --format json \
core editoast osrdyne gateway front \
| jq --raw-output '.[].ID')

docker compose \
-p "osrd-pr-tests" \
-f "docker/docker-compose.pr-tests.yml" \
down -v

# shellcheck disable=SC2086
docker rmi ${osrd_images}

fi
Loading