**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
28 lines
1.9 KiB
Markdown
28 lines
1.9 KiB
Markdown
# 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 project’s `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 repository’s `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).
|