Files
toolbox-portal/scripts/deploy-update.sh
T
2026-09-03 08:40:49 +02:00

24 lines
618 B
Bash

#!/usr/bin/env bash
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)"
cd "${PROJECT_DIR}"
git fetch origin --tags
git pull --ff-only origin main
if ! TAG="$(git describe --tags --exact-match 2>/dev/null)"; then
TAG="$(git describe --tags --abbrev=0 2>/dev/null || true)"
if [ -z "${TAG}" ]; then
echo "warning: current commit is untagged and no tagged ancestor was found"
else
echo "warning: current commit is untagged; nearest tag is ${TAG}"
fi
else
echo "tagged: ${TAG}"
fi
docker compose up -d --build
docker compose ps