Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • A Ahad Mobile
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Terraform modules
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • holatech
  • Ahad Mobile
  • Merge requests
  • !122

ci: deploy staging through the shared holapc template

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Khanh Pham requested to merge chore/ci-templates-staging into develop Oct 15, 2026
  • Overview 0
  • Commits 4
  • Pipelines 1
  • Changes 5

Move the Ahad staging deploy (develop → holapc) onto the shared template holatech1/ci-templates@v1 (.holapc-deploy, group runner #17 holapc-deploy). Prod is untouched.

Changes

  • .gitlab-ci.yml: include holapc/deploy.yml from holatech1/ci-templates at v1.
  • .gitlab/ci/staging.yml: new deploy:staging extends .holapc-deploy. The previous job is kept as deploy:staging:legacy (runner #13) and runs only when STAGING_DEPLOY_LEGACY=1, as a revert path for one release. Both share resource_group: staging, deploy.lock and DEPLOYED.staging.
  • deploy/compose.staging.yml: the template-deploy copy of the staging compose (IMAGE_API / IMAGE_ADMIN; same project moanapay-staging, containers, ports and mounts).
  • deploy/hooks/secrets.sh: Secrets Manager fetch of app-env and the four key files (same as the legacy staging step, without docker run -i).
  • deploy/hooks/migrate.sh: TypeORM migration:run on the new api image before up.

Health and rollback

The template checks every compose service plus localhost:3000/health, localhost:8091/healthz, https://ahad.holadev.xyz/health and https://admin-ahad.holadev.xyz/healthz, and on failure restores the previous tag for both images. Admin images are now tagged plain <sha> (legacy used <sha>-staging); the currently deployed admin image 0428f824 was retagged once so the first rollback works.

Verification

  • Template v1.4 proven on holatech1/ci-smoke on #17: happy path and forced health failure with rollback.
  • Hooks: bash -n, mode 100755, dry run with a stubbed docker.
  • Opus review gate: PASS after 2 rounds.
  • This job has not run in CI yet; the first run is the develop pipeline after merge.

Revert

Set CI/CD variable STAGING_DEPLOY_LEGACY=1 and retry. Before that, retag the admin image of the tag in DEPLOYED.staging from <sha> to <sha>-staging (see the header of staging.yml).

🤖 Generated with Claude Code

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: chore/ci-templates-staging