Nicolas Cantu db5a184851 feat(deploy): resolve project git root from conf.repository_root
**Motivations:**
- secrets_path dirname is not a stable git root when secrets move to ia_dev

**Correctifs:**
- lib/project_git_root_from_conf.sh: repository_root || git_work_tree || dirname(secrets_path)

**Evolutions:**
- lecoffreio conf.json: deploy.repository_root, deploy.hooks.phases scaffold
- pousse, branch-align, change-to-all-branches, deploy-by-script-to use resolver

**Pages affectées:**
- lib/project_git_root_from_conf.sh, deploy/*.sh, projects/lecoffreio/conf.json
2026-03-23 12:27:07 +01:00
..
2026-03-17 01:30:56 +01:00
2026-03-16 16:52:55 +01:00

ia_dev shared lib

project_config.sh

Sourced by deploy scripts and gitea-issues to resolve the current project id and the path to its JSON config.

Standalone usage: scripts are run from ia_dev root. Source after setting IA_DEV_ROOT (path to ia_dev); PROJECT_ROOT is derived by scripts when needed from config (e.g. project_path in conf.json).

After sourcing: PROJECT_ID and PROJECT_CONFIG_PATH are set (and exported). Config path is projects/<id>/conf.json. For token-based resolution, PROJECT_ENV is also set.

Project id resolution (no fallback):

  1. MAIL_TO (env): search all projects/*/conf.json for tickets.authorized_emails.to matching this address (string or list of env-keyed objects). The matching project directory name is the id.
  2. AI_AGENT_TOKEN (env): search all projects/<id>/.secrets/<env>/ia_token for matching token; sets PROJECT_ID and PROJECT_ENV (project and environment).

See projects/README.md for the config schema.