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: change call arguments for shutting down the docker #9426

Merged
merged 1 commit into from
Oct 24, 2024
Merged
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
25 changes: 17 additions & 8 deletions scripts/pr-tests-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,35 @@ esac

if {
[ "$#" -eq 3 ] &&
[ "$2" != "up-and-load-backup" ]
[ "$2" != "up-and-load-backup" ]
} ||
{
[ "$#" -eq 2 ] &&
{ [ "$2" != "up" ] &&
[ "$2" != "down" ] &&
[ "$2" != "down-and-clean" ]
}
[ "$2" != "up" ]
} ||
{
[ "$#" -eq 1 ] &&
[ "$1" != "down" ] &&
[ "$1" != "down-and-clean" ]
} ||
{
[ "$#" -ne 1 ] &&
[ "$#" -ne 2 ] &&
[ "$#" -ne 3 ]
}; then

echo "Usage: $0 pr-number (up | up-and-load-backup [osrd.backup] | down | down-and-clean )" >&2
echo "Usage: $0 ( [pr-number] (up | up-and-load-backup [osrd.backup]) | down | down-and-clean )" >&2
exit 1

fi

# Change ports in needed files
export PR_NB="pr-$1"
export PR_NB="" # We export a blank string for down and down-and-clean options not to produce a warning

if [ "$2" = "up" ] || [ "$2" = "up-and-load-backup" ]; then

export PR_NB="pr-$1"

if [ "$2" = "up-and-load-backup" ]; then

docker compose \
Expand All @@ -55,7 +64,7 @@ if [ "$2" = "up" ] || [ "$2" = "up-and-load-backup" ]; then
-f "docker/docker-compose.pr-tests.yml" \
up -d

elif [ "$2" = "down" ]; then
elif [ "$1" = "down" ]; then

# Shutdown the docker instance
docker compose \
Expand Down
Loading