feat: enhance deploy script with new flag for checking base image updates and improve usage instructions
Test Suite / test (24.15.0) (push) Has been cancelled

This commit is contained in:
Nils-Johan Gynther
2026-05-09 23:09:36 +02:00
parent da193b26ef
commit 8e276a34fe
+15 -6
View File
@@ -5,11 +5,12 @@
# #
# Användning: # Användning:
# ./deploy.sh bygg allt (backend + flutter + importer) # ./deploy.sh bygg allt (backend + flutter + importer)
# ./deploy.sh --backend bygg bara backend # ./deploy.sh --backend bygg bara backend (snabbast, ~2-3 min)
# ./deploy.sh --flutter bygg bara flutter # ./deploy.sh --flutter bygg bara flutter web-app
# ./deploy.sh --importer bygg bara importer # ./deploy.sh --importer bygg bara importer-microservice
# ./deploy.sh --seed kör seed (körs ej per default) # ./deploy.sh --seed kör full seed på databasen (opt-in)
# ./deploy.sh --backend --seed kombinera flaggor fritt # ./deploy.sh --pull-always kontrollera uppdateringar för basimages (flutter:3.41.9, node:24.15.0 etc)
# ./deploy.sh --backend --seed kombinera flaggor fritt (git pull körs alltid)
set -e set -e
@@ -21,6 +22,7 @@ BUILD_BACKEND=false
BUILD_FLUTTER=false BUILD_FLUTTER=false
BUILD_IMPORTER=false BUILD_IMPORTER=false
RUN_SEED=false RUN_SEED=false
PULL_IMAGES=false # --pull=false är standard (snabbt)
BUILD_ALL=true # om inga specifika tjänster anges, bygg allt BUILD_ALL=true # om inga specifika tjänster anges, bygg allt
for arg in "$@"; do for arg in "$@"; do
@@ -29,6 +31,7 @@ for arg in "$@"; do
--flutter) BUILD_FLUTTER=true; BUILD_ALL=false ;; --flutter) BUILD_FLUTTER=true; BUILD_ALL=false ;;
--importer) BUILD_IMPORTER=true; BUILD_ALL=false ;; --importer) BUILD_IMPORTER=true; BUILD_ALL=false ;;
--seed) RUN_SEED=true ;; --seed) RUN_SEED=true ;;
--pull-always) PULL_IMAGES=true ;;
--help|-h) --help|-h)
sed -n '/^# Användning:/,/^[^#]/p' "$0" | grep '^#' | sed 's/^# \?//' sed -n '/^# Användning:/,/^[^#]/p' "$0" | grep '^#' | sed 's/^# \?//'
exit 0 exit 0
@@ -66,8 +69,14 @@ SERVICES=""
[ "$BUILD_IMPORTER" = true ] && SERVICES="$SERVICES importer-api" [ "$BUILD_IMPORTER" = true ] && SERVICES="$SERVICES importer-api"
echo "Bygger: ${SERVICES:-alla tjänster}..." echo "Bygger: ${SERVICES:-alla tjänster}..."
# --pull=false hindrar Docker från att kontrollera nya versioner av basimages if [ "$PULL_IMAGES" = true ]; then
# Kontrollera om nya versioner av basimages finns på Docker Hub / ghcr.io
echo " (kontrollerar uppdateringar för basimages...)"
$COMPOSE build $SERVICES
else
# Standard: använd lokala cachade images, snabbare
$COMPOSE build --pull=false $SERVICES $COMPOSE build --pull=false $SERVICES
fi
echo "Startar tjänster..." echo "Startar tjänster..."
$COMPOSE up -d $COMPOSE up -d