Skip to content

Commit

Permalink
style(scripts): refine var name of flavor compose file
Browse files Browse the repository at this point in the history
  • Loading branch information
poikilotherm committed Apr 6, 2024
1 parent f68eb68 commit f1f9a72
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions scripts/service.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
set -euo pipefail

SCRIPT_DIR=$(dirname "${0}")
COMPOSE_FILE=""
FILE_OPTION=""
FLAVOR_COMPOSE_FILE=""
FLAVOR_FILE_OPTION=""
DETACH_OPTION=""
PROJECT_OPTION=""

while getopts ":f:p:dh" OPTION
do
case "$OPTION" in
p ) PROJECT_OPTION="$OPTARG" ;;
f ) COMPOSE_FILE="$OPTARG"; FILE_OPTION="-f ${COMPOSE_FILE}" ;;
f ) FLAVOR_COMPOSE_FILE="$OPTARG"; FLAVOR_FILE_OPTION="-f ${FLAVOR_COMPOSE_FILE}" ;;
d ) DETACH_OPTION="-d" ;;
h ) usage; exit 0;;
\? ) echo "Unknown option: -$OPTARG" >&2; usage; exit 1;;
Expand All @@ -23,7 +23,7 @@ done
shift $((OPTIND-1))

# shellcheck disable=SC2086
docker compose -f "${SCRIPT_DIR}/../docker-compose.yml" ${FILE_OPTION} \
docker compose -f "${SCRIPT_DIR}/../docker-compose.yml" ${FLAVOR_FILE_OPTION} \
-p "${PROJECT_OPTION}" up ${DETACH_OPTION} --quiet-pull

echo -e "✅️ Dataverse containers have been started."
10 changes: 5 additions & 5 deletions test/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ if ! [[ "$ACTION" == "start" || "$ACTION" == "stop" ]]; then
echo "First parameter must be 'start' or 'stop'" >&2; exit 1
fi

COMPOSE_FILE=""
FILE_OPTION=""
FLAVOR_COMPOSE_FILE=""
FLAVOR_FILE_OPTION=""
DETACH_OPTION="-d"

while getopts ":f:dh" OPTION
do
case "$OPTION" in
f ) COMPOSE_FILE="$OPTARG"; FILE_OPTION="-f ${COMPOSE_FILE}" ;;
f ) FLAVOR_COMPOSE_FILE="$OPTARG"; FLAVOR_FILE_OPTION="-f ${FLAVOR_COMPOSE_FILE}" ;;
d ) DETACH_OPTION="" ;;
h ) usage; exit 0;;
\? ) echo "Unknown option: -$OPTARG" >&2; usage; exit 1;;
Expand All @@ -54,8 +54,8 @@ fi

if [[ "$ACTION" == "start" ]]; then
# shellcheck disable=SC2086
"${TEST_DIR}/../scripts/service.sh" ${FILE_OPTION} -p "apitest" "${DETACH_OPTION}"
"${TEST_DIR}/../scripts/service.sh" ${FLAVOR_FILE_OPTION} -p "apitest" "${DETACH_OPTION}"
elif [[ "$ACTION" == "stop" ]]; then
# shellcheck disable=SC2086
docker compose -f "$TEST_DIR/../docker-compose.yml" ${FILE_OPTION} -p "apitest" down -v
docker compose -f "$TEST_DIR/../docker-compose.yml" ${FLAVOR_FILE_OPTION} -p "apitest" down -v
fi

0 comments on commit f1f9a72

Please sign in to comment.