**Motivations:** - Single config file per project (projects/<id>/conf.json) - Project must not depend on ia_dev; only ia_dev solicits the project **Root causes:** - N/A (evolution) **Correctifs:** - N/A **Evolutions:** - lib/project_config.sh: resolve PROJECT_SLUG from IA_PROJECT, .ia_project, ai_project_id; PROJECT_CONFIG_PATH = projects/<id>/conf.json - projects/lecoffreio.json moved to projects/lecoffreio/conf.json; projects/ia_dev/conf.json added - deploy: branch-align, bump-version, change-to-all-branches, pousse, deploy-by-script-to use PROJECT_ROOT/IA_DEV_ROOT and project_config.sh; SCRIPT_REAL for symlink-safe paths - deploy/_lib: shared colors, env-map, ssh, git-flow - gitea-issues: mail list/mark-read/get-thread/send-reply, thread log, agent-loop, wiki scripts; lib.sh loads project config - README: principle no dependency from host project; invoke ./ia_dev/deploy/bump-version.sh etc. from repo root **Pages affectées:** - README.md, projects/README.md, lib/, deploy/, gitea-issues/, projects/lecoffreio/, projects/ia_dev/
33 lines
1.4 KiB
Bash
Executable File
33 lines
1.4 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# From branch test only: align origin/test, origin/pprod, origin/prod then deploy to test (import-v1, skipSetupHost).
|
|
# Use when you have already pushed to test and want to sync other branches and deploy test in one go.
|
|
set -euo pipefail
|
|
|
|
if ! git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
|
echo "[change-to-all-branches][ERROR] Not in a git repository" >&2
|
|
exit 1
|
|
fi
|
|
|
|
PROJECT_ROOT="$(git rev-parse --show-toplevel)"
|
|
SCRIPT_REAL="$(readlink -f "${BASH_SOURCE[0]:-$0}" 2>/dev/null || realpath "${BASH_SOURCE[0]:-$0}" 2>/dev/null || echo "${BASH_SOURCE[0]:-$0}")"
|
|
DEPLOY_DIR="$(cd "$(dirname "$SCRIPT_REAL")" && pwd)"
|
|
if [[ "$(pwd)" != "$PROJECT_ROOT" ]]; then
|
|
cd "$PROJECT_ROOT" && exec "${DEPLOY_DIR}/$(basename "${BASH_SOURCE[0]:-$0}")" "$@"
|
|
fi
|
|
|
|
current="$(git rev-parse --abbrev-ref HEAD)"
|
|
if [[ "$current" != "test" ]]; then
|
|
echo "[change-to-all-branches][ERROR] Must be on branch 'test' (current: '${current}')" >&2
|
|
exit 1
|
|
fi
|
|
|
|
echo "[change-to-all-branches] Aligning branches..."
|
|
"$DEPLOY_DIR/branch-align.sh" test
|
|
|
|
# scripts_v2 lives in the host project's deploy/ (not necessarily under ia_dev)
|
|
DEPLOY_SCRIPTS_V2="${PROJECT_ROOT}/deploy/scripts_v2"
|
|
echo "[change-to-all-branches] Deploying test (--import-v1 --skipSetupHost, --no-sync-origin because we just pushed)..."
|
|
"${DEPLOY_SCRIPTS_V2}/deploy.sh" test --import-v1 --skipSetupHost --no-sync-origin
|
|
|
|
echo "[change-to-all-branches] OK"
|