test
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
ci/woodpecker/cron/woodpecker Pipeline was successful

This commit is contained in:
dvirlabs 2026-04-24 15:48:18 +03:00
parent fa9ab6e123
commit 287bb60211

View File

@ -248,10 +248,22 @@ if [ "$MODE" = "post-deploy" ]; then
fi
DEPLOYED_FILES_JSON+="]"
else
# Drift-check mode: populate drifted_files, keep deployed_files empty
DEPLOYED_FILES_JSON="[]"
DRIFTED_FILES_JSON="["
# Drift-check mode: Keep existing deployed_files, only update drifted_files
# First fetch current status to preserve deployed_files
echo " Fetching current deployed_files from API..."
CURRENT_JSON=$(curl -s "$GITOPS_STATUS_SERVER_URL/api/status" 2>/dev/null || echo "{}")
# Extract deployed_files from current JSON (use jq if available)
if command -v jq >/dev/null 2>&1; then
DEPLOYED_FILES_JSON=$(echo "$CURRENT_JSON" | jq -c '.deployed_files // []' 2>/dev/null || echo "[]")
echo " Preserving deployed_files: $DEPLOYED_FILES_JSON"
else
DEPLOYED_FILES_JSON="[]"
echo " WARNING: jq not available, cannot preserve deployed_files"
fi
# Build drifted_files from detected drift
DRIFTED_FILES_JSON="["
if [ ${#CHANGED_FILES[@]} -gt 0 ]; then
for i in "${!CHANGED_FILES[@]}"; do
if [ "$i" -gt 0 ]; then