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: includeholapc/deploy.ymlfromholatech1/ci-templatesatv1. -
.gitlab/ci/staging.yml: newdeploy:stagingextends.holapc-deploy. The previous job is kept asdeploy:staging:legacy(runner #13) and runs only whenSTAGING_DEPLOY_LEGACY=1, as a revert path for one release. Both shareresource_group: staging,deploy.lockandDEPLOYED.staging. -
deploy/compose.staging.yml: the template-deploy copy of the staging compose (IMAGE_API/IMAGE_ADMIN; same projectmoanapay-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, withoutdocker run -i). -
deploy/hooks/migrate.sh: TypeORMmigration:runon the new api image beforeup.
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-smokeon #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).