Skip to content

Commit

Permalink
Improve usage of run_on_docker.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
kokosing committed Oct 7, 2019
1 parent 9c1b9d8 commit ba3c4db
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
7 changes: 7 additions & 0 deletions presto-product-tests/bin/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,10 @@ function getAvailableEnvironments() {
| grep -v files | grep -v common | xargs -n1 basename
}

function usage() {
echo "Usage: $0 <environment> $@"
echo
echo "Where <environment> is one of following:"
getAvailableEnvironments | sort | sed 's/^/ - /'
exit 1
}
7 changes: 1 addition & 6 deletions presto-product-tests/bin/run_on_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,8 @@ function terminate() {
exit 130
}

function usage() {
echo "Usage: run_on_docker.sh <`getAvailableEnvironments | tr '\n' '|' | sed 's/|$//'`> <product test args>"
exit 1
}

if [[ $# == 0 ]]; then
usage
usage "<product test arguments>"
fi

ENVIRONMENT=$1
Expand Down
7 changes: 1 addition & 6 deletions presto-product-tests/bin/run_presto_cli_on_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ set -euo pipefail

source "${BASH_SOURCE%/*}/lib.sh"

function usage() {
echo "Usage: $0 <`getAvailableEnvironments | tr '\n' '|' | sed 's/|$//'`> <presto cli args>"
exit 1
}

if [[ $# == 0 ]]; then
usage
usage "<presto cli arguments>"
fi

ENVIRONMENT=$1
Expand Down
7 changes: 1 addition & 6 deletions presto-product-tests/bin/run_tempto_on_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@ set -euo pipefail

source "${BASH_SOURCE%/*}/lib.sh"

function usage() {
echo "Usage: $0 <`getAvailableEnvironments | tr '\n' '|' | sed 's/|$//'`> <tempto args>"
exit 1
}

if [[ $# == 0 ]]; then
usage
usage "<tempto arguments>"
fi

ENVIRONMENT=$1
Expand Down

0 comments on commit ba3c4db

Please sign in to comment.