ia_dev/deploy/lib/README.md
Nicolas Cantu f1c53477b0 feat(deploy): methodology lib and project_orchestrator_path
**Motivations:**
- Keep shared methodology, envs, and future quality sequences in ia_dev; single project orchestrator script per repo

**Root causes:**
- N/A

**Correctifs:**
- N/A

**Evolutions:**
- Add deploy/lib/deploy-methodology.sh (test|pprod|prod validation)
- deploy.sh sources methodology before orchestrator
- orchestrator prefers deploy.project_orchestrator_path then legacy phases/deploy_script_path
- conf.json: project_orchestrator_path for lecoffreio, algo, enso; remove hooks where redundant
- Document in README.md, projects/README.md, deploy/lib/README.md

**Pages affectées:**
- deploy/*, projects/*/conf.json, README files
2026-03-23 13:19:03 +01:00

28 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Shared deploy libraries (ia_dev)
## `ssh.sh`
Canonical SSH/SCP helpers (`ssh_run`, `scp_copy`, `require_ssh_key`, `ssh_common_opts`) used across projects.
**LeCoffre** : `deploy/scripts_v2/_lib/ssh.sh` sources `ia_dev/deploy/lib/ssh.sh` when the submodule path `ia_dev/deploy/lib/ssh.sh` exists from the repo root; otherwise it embeds the same implementation.
## `deploy-log.sh`
Optional `deploy_script_tee_log_if_requested <project_root> <log_subdir>` — requires `info` from the projects `colors.sh` (sourced before this file in `deploy.sh`).
## Policy
Project-specific logic (Prisma, systemd unit names, remote app layout, LeCoffre domains) stays under each repositorys `deploy/scripts_v2/`. Only transport/logging helpers live here.
## `deploy-methodology.sh`
Shared contract for all managed projects: allowed envs (`test` \| `pprod` \| `prod`), validation helpers. Sourced by **`deploy.sh`** and **`orchestrator.sh`**. Extend only with an explicit decision (new env = conf + doc migration).
Quality gates and longer sequences that are identical across projects should be added here (or in small `deploy/lib/deploy-*.sh` peers) over time — not in project repos.
## Orchestration (`../orchestrator.sh`, `../deploy.sh`)
- **`deploy.sh`** : `./deploy/deploy.sh <project_id> <env> [args]` — applies methodology (env validation, banner), sets `IA_PROJECT_ID`, then **`exec orchestrator.sh`**.
- **`orchestrator.sh`** : exports secrets from conf, then **`exec`** the **project orchestrator** `repository_root` + `deploy.project_orchestrator_path` (relative path) with the same `"$@"`. **Legacy** : if `project_orchestrator_path` is missing, uses `deploy.hooks.phases` or `deploy.deploy_script_path`. **`run-project-hooks.sh`** execs `orchestrator.sh` for backward compatibility.
Project orchestrator = single script in the target repo that sequences project-specific steps (`deploy.sh` LeCoffre today, or a dedicated `orchestrate-project.sh` later).