ilia c2e797a027
All checks were successful
CI / skip-ci-check (pull_request) Successful in 1m22s
CI / lint-and-test (pull_request) Successful in 1m27s
CI / ansible-validation (pull_request) Successful in 2m53s
CI / secret-scanning (pull_request) Successful in 1m24s
CI / dependency-scan (pull_request) Successful in 1m28s
CI / sast-scan (pull_request) Successful in 2m32s
CI / license-check (pull_request) Successful in 1m28s
CI / vault-check (pull_request) Successful in 2m30s
CI / playbook-test (pull_request) Successful in 2m32s
CI / container-scan (pull_request) Successful in 1m53s
CI / sonar-analysis (pull_request) Successful in 2m40s
CI / workflow-summary (pull_request) Successful in 1m22s
feat(app_setup): improve deployment reliability and add mirrormatch support
- Fix deploy script to handle non-git directories by cloning to temp
  location and moving contents, preserving .env files during clone
- Remove comment lines from env.j2 template to prevent xargs errors
- Add initial deploy task to app_setup role to ensure app is deployed
  before service starts
- Fix migrate command precedence to check env-specific overrides first
- Add sudo to systemctl restart commands in deploy script
- Update documentation with project-specific configuration notes

These changes improve deployment reliability for all app projects while
adding support for mirrormatch-specific requirements (db:push, seeding).
All changes are backward-compatible with existing projects (pote, punimTag).
2026-01-04 16:50:54 -05:00
..

app_setup

Creates the standard app filesystem layout and runtime services:

  • /srv/app/backend and /srv/app/frontend
  • /srv/app/.env.<dev|qa|prod>
  • /usr/local/bin/deploy_app.sh (git pull, install deps, build, migrate, restart services)
  • systemd units:
    • app-backend.service
    • app-frontend.service

All behavior is driven by variables so you can reuse this role for multiple projects.

Variables

See defaults/main.yml. Common inputs in the app stack:

  • app_project, app_env (used for naming and .env.<env> selection)
  • app_repo_url, app_repo_dest, app_repo_branch
  • app_env_vars (map written into /srv/app/.env.<env>)
  • components.backend, components.frontend (enable/disable backend/frontend setup)
  • app_backend_dir, app_frontend_dir, ports and Node.js commands