version_app

This commit is contained in:
Mateusz Gruszczyński
2025-09-23 12:42:22 +02:00
parent bbe318f995
commit f2b7c8a64a
2 changed files with 32 additions and 19 deletions

View File

@@ -23,7 +23,6 @@ if ! docker compose version >/dev/null 2>&1; then
fi
if [[ ! -f "$REPO_DIR/$COMPOSE_FILE" ]]; then
# Spróbuj alternatywnej nazwy
if [[ -f "$REPO_DIR/compose.yaml" ]]; then
COMPOSE_FILE="compose.yaml"
else
@@ -41,6 +40,10 @@ git fetch --prune "$GIT_REMOTE"
git checkout "$GIT_BRANCH" >/dev/null 2>&1 || true
git pull --ff-only "$GIT_REMOTE" "$GIT_BRANCH"
# --- Zapisanie wersji do pliku ---
log "Zapisywanie hasha commita do version.txt"
git rev-parse --short HEAD > version.txt
# --- Zatrzymanie i usunięcie bieżącego stacka ---
log "Docker Compose DOWN (usuwanie kontenerów i osieroconych usług)"
docker compose -f "$COMPOSE_FILE" down --remove-orphans
@@ -53,4 +56,4 @@ else
docker compose -f "$COMPOSE_FILE" up -d --no-deps --build
fi
log "Gotowe ✅"
log "Gotowe ✅ (wersja: $(cat version.txt))"