This commit is contained in:
2026-03-06 23:49:26 +01:00
parent c540d8d0aa
commit c0adcdd45a

View File

@@ -2,6 +2,7 @@ stages:
- deploy
variables:
# CONFIG wird separat gemischt und nach /config synchronisiert
BASE_DIRS: "api data debug modules partials public src tools"
CONFIG_BASE_DIR: "config"
LOCAL_ROOT: "/mnt/nexusserver"
@@ -36,16 +37,17 @@ default:
echo "🚀 Deploy ${DEPLOY_ENV} → ${TARGET_PATH}"
# --- Sync base dirs ---
for d in $BASE_DIRS; do
if [ -d "$d" ]; then
echo "🔁 Sync ${d}/ → ${TARGET_PATH}${d}/"
mkdir -p "${TARGET_PATH}${d}/"
rsync -a --delete --exclude=".gitkeep" "${d}/" "${TARGET_PATH}${d}/"
else
echo "⚠️ Verzeichnis $d existiert nicht im Repo, überspringe Sync."
fi
done
# --- Sync Workspace (ohne config/) ---
echo "🔁 Sync Workspace → ${TARGET_PATH} (ohne config/)"
rsync -a --delete \
--exclude=".git" \
--exclude=".ci_config_deploy" \
--exclude="config/" \
--exclude=".gitlab-ci.yml" \
--exclude="README.md" \
--exclude="PROJECT_CONTEXT.md" \
--exclude=".gitkeep" \
"./" "${TARGET_PATH}"
# --- Build mixed config ---
echo "🧩 Baue gemischtes Config-Verzeichnis (config/*.php + ${CONFIG_ENV_DIR})..."
@@ -62,6 +64,10 @@ default:
cp -R "${CONFIG_ENV_DIR}/." .ci_config_deploy/
fi
# --- Ensure env subdirs are removed on target ---
echo "🧹 Entferne ${TARGET_PATH}${CONFIG_BASE_DIR}/prod und /staging falls vorhanden..."
rm -rf "${TARGET_PATH}${CONFIG_BASE_DIR}/prod" "${TARGET_PATH}${CONFIG_BASE_DIR}/staging"
echo "🔁 Sync .ci_config_deploy/ → ${TARGET_PATH}${CONFIG_BASE_DIR}/"
mkdir -p "${TARGET_PATH}${CONFIG_BASE_DIR}/"
rsync -a --delete --exclude=".gitkeep" ".ci_config_deploy/" "${TARGET_PATH}${CONFIG_BASE_DIR}/"