diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 294bf6e..cb2730b 100644 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -1,4 +1,18 @@ #!/usr/bin/env sh set -e -ENV=${1:-prod} -APP_ENV=$ENV docker compose up -d --build +ENV=${1:-test} +MODE=${2:-no-build} +ENVFILE="" +if [ -f ".env.$ENV" ]; then ENVFILE="--env-file .env.$ENV"; fi +case "$MODE" in + no-build) + APP_ENV=$ENV docker compose $ENVFILE up -d ;; + rebuild) + APP_ENV=$ENV docker compose $ENVFILE build --no-cache + APP_ENV=$ENV docker compose $ENVFILE up -d ;; + pull) + APP_ENV=$ENV docker compose $ENVFILE build --pull + APP_ENV=$ENV docker compose $ENVFILE up -d ;; + build|*) + APP_ENV=$ENV docker compose $ENVFILE up -d --build ;; +esac