Etat initial - Agents and project docs still referenced --skipSetupHost, --import-v1 on CLI, and optional log flags. Motivation du changement - Align ia_dev agents and mirrored docs with LeCoffre deploy.sh (setup via run-setup-host.sh, business flags in deploy.conf only, logs always on). Resolution - Add .cursor/agents/setup-host.md; update change-to-all-branches, deploy-by-script, deploy-pprod-or-prod; refresh agents-scripts-split and WORKFLOWS for lecoffreio and ia_dev projects. Root cause - Documentation drift after deploy CLI and pipeline changes. Fonctionnalités impactées - Cursor agent instructions only (no runtime code path change in this commit beyond files listed). Code modifié - .cursor/agents/*.md, deploy/*.sh, deploy/lib/*.sh, projects/*/docs/*.md as staged. Documentation modifiée - projects/lecoffreio/docs/agents-scripts-split.md, WORKFLOWS_AND_COMPONENTS.md; projects/ia_dev/docs/* (same). Configurations modifiées - none. Fichiers dans déploy modifiés - deploy/change-to-all-branches.sh, deploy-by-script-to.sh, deploy.sh, lib/README.md, deploy-conf-handling.sh, deploy-methodology.sh, orchestrator.sh (pre-existing session changes + doc alignment). Fichiers dans logs impactés - none. Bases de données et autres sources modifiées - none. Modifications hors projet - none. fichiers dans .cursor/ modifiés - .cursor/agents/setup-host.md (new), change-to-all-branches.md, deploy-by-script.md, deploy-pprod-or-prod.md. fichiers dans .secrets/ modifiés - none. nouvelle sous sous version dans VERSION - N/A (ia_dev repo has no VERSION file). CHANGELOG.md mise à jour (oui/non) - non
50 lines
1.9 KiB
Bash
50 lines
1.9 KiB
Bash
#!/usr/bin/env bash
|
||
# Shared deploy methodology for all ia_dev–managed projects: environments, quality bar, ordering contract.
|
||
# Sourced by ia_dev/deploy/deploy.sh and ia_dev/deploy/orchestrator.sh — no project-specific paths here.
|
||
#
|
||
# Boundary (approved workflow):
|
||
# - Everything strictly identical across projects (allowed envs, shared tooling checks, shared conf.json
|
||
# field handling) lives in deploy-methodology.sh and siblings under deploy/lib/ (e.g. deploy-conf-handling.sh).
|
||
# - The repository’s project orchestrator (deploy.project_orchestrator_path) only sequences project-specific
|
||
# work (e.g. LeCoffre: _lib/deploy-phase-*.sh, remote layout, Prisma, systemd unit names).
|
||
# When a step is candidate for hoisting, move it here or into a small deploy/lib/*.sh peer; shrink the project script.
|
||
|
||
# Environments are fixed across projects; extend only with an explicit decision and conf migration.
|
||
IA_DEV_DEPLOY_ENVS=(test pprod prod)
|
||
|
||
# ia_dev_deploy_env_is_allowed <word> — exit 0 if allowed
|
||
ia_dev_deploy_env_is_allowed() {
|
||
local e="${1:-}"
|
||
local x
|
||
for x in "${IA_DEV_DEPLOY_ENVS[@]}"; do
|
||
if [[ "$e" == "$x" ]]; then
|
||
return 0
|
||
fi
|
||
done
|
||
return 1
|
||
}
|
||
|
||
# ia_dev_deploy_assert_first_arg_env "$@" — first positional must be test|pprod|prod; stderr + exit 1 otherwise
|
||
ia_dev_deploy_assert_first_arg_env() {
|
||
if [[ $# -lt 1 ]]; then
|
||
echo "[ia_dev][deploy][ERROR] Missing <env> (expected: test | pprod | prod)" >&2
|
||
return 1
|
||
fi
|
||
local env_arg="$1"
|
||
ia_dev_deploy_assert_env_literal "$env_arg"
|
||
}
|
||
|
||
# ia_dev_deploy_assert_env_literal <env> — validate a single env token
|
||
ia_dev_deploy_assert_env_literal() {
|
||
local env_arg="${1:-}"
|
||
if [[ -z "$env_arg" ]]; then
|
||
echo "[ia_dev][deploy][ERROR] Missing <env> (expected: test | pprod | prod)" >&2
|
||
return 1
|
||
fi
|
||
if ! ia_dev_deploy_env_is_allowed "$env_arg"; then
|
||
echo "[ia_dev][deploy][ERROR] Invalid env '${env_arg}' (allowed: ${IA_DEV_DEPLOY_ENVS[*]})" >&2
|
||
return 1
|
||
fi
|
||
return 0
|
||
}
|