File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,6 @@ ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
55COMPOSE=" docker compose -f ${ROOT_DIR} /docker-compose.yml -f ${ROOT_DIR} /docker-compose.test-api.yml"
66BUILD_IMAGES_STACK=(api dbapi nslord nsmaster dblord dbmaster)
77BUILD_IMAGES_DB=(dbapi)
8- KEEP=0
98BUILD=1
109MODE=" host"
1110PROD_DB=0
@@ -17,9 +16,8 @@ CACHE_FILE="${CACHE_DIR}/dbapi.sql.gz"
1716
1817usage () {
1918 cat << 'EOF '
20- Usage: ./run-api-tests-stack.sh [--no-build] [--keep] [-- docker] [--prod-db] [--prod-user USER] [--prod-host HOST] [--refresh-prod-db]
19+ Usage: ./run-api-tests-stack.sh [--no-build] [--docker] [--prod-db] [--prod-user USER] [--prod-host HOST] [--refresh-prod-db]
2120 --no-build Skip docker image build step
22- --keep Do not tear down containers/volumes after tests
2321 --docker Run API tests inside the api container (CI-style)
2422 --prod-db Download a logical dbapi dump from production and load it locally
2523 --prod-user SSH username for prod (default: root)
3129while [[ $# -gt 0 ]]; do
3230 case " $1 " in
3331 --no-build) BUILD=0 ;;
34- --keep) KEEP=1 ;;
3532 --docker) MODE=" docker" ;;
3633 --prod-db) PROD_DB=1 ;;
3734 --prod-user)
@@ -104,12 +101,10 @@ restore_dbapi_from_cache() {
104101
105102cleanup () {
106103 $COMPOSE ps || true
107- $COMPOSE down -v || true
104+ $COMPOSE down || true
108105}
109106
110- if [[ " $KEEP " -eq 0 ]]; then
111- trap cleanup EXIT
112- fi
107+ trap cleanup EXIT
113108
114109if [[ " $MODE " == " docker" ]]; then
115110 if [[ " $PROD_DB " -eq 1 ]]; then
You can’t perform that action at this time.
0 commit comments