- Default PULL_SYNC_LOG to logs/git-pull-projects.log; add logs/README and gitignore - Add services/ia_dev integration README and .env.example - Replace docs/ia_dev-submodule.md with ia_dev-module.md; update ecosystem and README links - Point ia_dev submodule to commit with smart_ide_logs.sh
45 lines
1.1 KiB
Bash
Executable File
45 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Charge cron/config.env (+ optionnel config.local.env) puis exécute git-pull-project-clones.sh.
|
|
set -euo pipefail
|
|
|
|
ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
|
load_env() {
|
|
local f="$1"
|
|
[[ -f "$f" ]] || return 0
|
|
set -a
|
|
# shellcheck source=/dev/null
|
|
source "$f"
|
|
set +a
|
|
}
|
|
|
|
load_env "$ROOT/cron/config.env"
|
|
load_env "$ROOT/cron/config.local.env"
|
|
|
|
if [[ "${PULL_SYNC_ENABLED:-1}" == "0" ]]; then
|
|
exit 0
|
|
fi
|
|
|
|
LOG="${PULL_SYNC_LOG:-$ROOT/logs/git-pull-projects.log}"
|
|
mkdir -p "$(dirname "$LOG")" 2>/dev/null || true
|
|
|
|
{
|
|
echo "=== $(date -Iseconds) pull-sync ==="
|
|
case "${PULL_SYNC_MODE:-all}" in
|
|
all)
|
|
"$ROOT/cron/git-pull-project-clones.sh" --all
|
|
;;
|
|
project)
|
|
if [[ -z "${PULL_SYNC_PROJECT_ID:-}" ]]; then
|
|
echo "[git-pull-wrapper] PULL_SYNC_PROJECT_ID requis quand PULL_SYNC_MODE=project" >&2
|
|
exit 1
|
|
fi
|
|
"$ROOT/cron/git-pull-project-clones.sh" --project "$PULL_SYNC_PROJECT_ID"
|
|
;;
|
|
*)
|
|
echo "[git-pull-wrapper] PULL_SYNC_MODE invalide: ${PULL_SYNC_MODE:-}" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
echo "=== fin ==="
|
|
} >>"$LOG" 2>&1
|