Skip to content

Version control and releases

How we version, release and deploy Playtelly services. For image signing and the cluster policy, see Security: Image Signing Guide.


1. Overview

One image runs everywhere. It is built once on staging, tested, scanned and signed. Production and every customer run the same image (same digest), relabelled with a version tag. Nothing is rebuilt or copied per customer.

feature -> MR -> staging (test, build, package, sign, deploy to staging)
        -> MR -> main (runs nothing)
        -> tag vX.Y.Z on the NEWEST STAGING COMMIT
        -> promote:production (relabels the same signed image)
        -> a human presses play: update_tag:production, deploy:<customer>
        -> iac repo newTag -> ArgoCD

Key principles:

Principle Meaning
Build once Every push to staging builds one multi-arch image, staging-<sha>.
Promote, don't rebuild A vX.Y.Z tag relabels the staging image as prod-vX.Y.Z.
Merging to main deploys nothing Production moves only when a tag is pushed and a human presses play.
Only signed images run Images are signed in CI and checked in the cluster (see the Security guide).
Production approval is human Never automate update_tag:production or deploy:*.

2. Version control

Branches

Branch Purpose Pipeline
feature/* Day-to-day work, merged by MR into staging test and scan on the MR
staging Integration branch, builds the release image test, build, package, sign, deploy to staging
main Release history, receives merges from staging none
prod/<customer> Legacy per-customer branches, kept only for customers not yet switched legacy build, being removed

Protect staging, main, prod/* and the tag pattern v* (Maintainers only).

Commit messages

Use Conventional Commits:

Prefix Use for
feat: New capability
feat!: Breaking change
fix: Bug fix
ci: Pipeline changes
docs: Documentation only
chore: Maintenance
test: Tests only

Commits that are only docs:, ci:, chore: or test: do not need a release.

Choosing the version number

Versions are vX.Y.Z (Semantic Versioning). The tag must be exactly vX.Y.Z.

List what changed since the last release and take the highest bump:

git log --oneline <last-tag>..origin/staging
Change Bump
An existing client would break (endpoint, field or cookie removed or renamed, token format changed, rule tightened, optional made required) MAJOR
New capability old clients can ignore (new endpoint, new optional field) MINOR
Fix only, no visible behaviour change PATCH

Rules while the version is 0.y.z:

  • A breaking change bumps MINOR.
  • Everything else bumps PATCH.
  • A new required environment variable is at least a MINOR. Check that the customers' secrets or configmaps have it before they deploy.

Tags are never moved, deleted or reused. If a release is wrong, ship the next patch.


3. Release process

Checklist

  1. Check staging is green. The pipeline for the newest staging commit must pass, including sign:staging. Nobody may push to staging between that build and the tag.
  2. Choose the version (section 2) and get it confirmed.
  3. Merge staging into main with a merge request in GitLab:
  4. no squash
  5. no rebase
  6. do not delete the source branch
  7. Tag the newest staging commit, not the merge commit on main (the merge commit has no staging image):
git fetch origin
git log --oneline -1 origin/staging
git tag -a vX.Y.Z <that-sha> -m "vX.Y.Z"
git push origin vX.Y.Z
  1. Wait for promote:production to finish. It relabels the signed staging image as prod-vX.Y.Z.
  2. Press play on update_tag:production the same day. This writes newTag in the iac repo and ArgoCD syncs.
  3. Press play on deploy:<customer> for each customer that should follow.

Release the same day you merge. The nightly Nexus cleanup (02:00) keeps only the newest staging image and every prod-vX.Y.Z, so an untagged staging image can disappear.

Releases so far

Version Notes
v0.0.1 First release, production and IBC
v0.0.2 CoreAPI

4. Deployment

Where the real version lives

The deployed version is the newTag value in the iac repo, not the tag in the application repo.

Environment Overlay
Staging playtelly-iac services overlay staging
Production playtelly-iac services overlay prod
IBC ibc-iac application overlays
Hotel hotel-iac application overlays

ArgoCD syncs the iac repo, so a change to newTag goes live at the next sync.

Customers

Customer Image Deployed by
IBC shared Playtelly image, prod-vX.Y.Z deploy:ibc
Hotel, jastv, ticketing own namespace copy, prod-<sha> legacy push to prod/<customer> (until switched)

deploy:<customer> jobs:

  • run from the tag pipeline, or from Run pipeline on main with DEPLOY_CUSTOMER and DEPLOY_VERSION
  • check the image signature before deploying
  • stop at an overlay guard until that customer's overlay uses the shared image, and write nothing

IBC lands on main of ibc-iac. Hotels follow when the change is promoted main -> canary -> stable.

Switching a customer to the shared image

  1. Check the customer's pull secret can read the Playtelly image in Nexus.
  2. In the customer's iac repo, change the image in the base deployment and the overlay images[].name to the shared Playtelly image, with newTag set to a released prod-vX.Y.Z. That commit deploys it.
  3. From then on deploy the customer with deploy:<customer>.
  4. Clean up the legacy flow:
  5. remove the customer's jobs from the legacy CI file
  6. remove its name from the prod/(...) workflow rule
  7. delete the prod/<customer> branch

Browser configuration

Front-end apps (Promoweb, castis-website) read their browser config at runtime, so one image works in every environment. Do not bake environment URLs into the build.


5. Pipeline reference

Event Jobs
Merge request tests, source scan
Push to staging AI review, tests, source scan, build:staging, package:staging, sign:staging, update_tag:staging
Push or merge to main none
Tag vX.Y.Z promote:production, then manual update_tag:production and manual deploy:<customer>
Run pipeline on main with DEPLOY_CUSTOMER and DEPLOY_VERSION that deploy:<customer> only
Push to prod/<customer> legacy build (until the customer is switched)

Notes:

  • Tests and scans run on merge requests and the staging push. The staging -> main MR shows the staging pipeline of the same commit instead of running them again.
  • Tag pipelines use the CI files of the tagged commit, so a CI change only applies to tags created after it is in main.
  • Shared templates live in ci-templates and are included at ref: main. A change there affects every service, so do not edit it without agreement.
  • Projects whose image is not named after the project can set the optional IMAGE_NAME variable.
  • The lint job logs in to the Nexus npm registry using CI variables.

Changing CI YAML safely

  1. Parse every file and check extends and needs.
  2. Simulate the rules for: a staging push, a merge to main, a tag, a Run pipeline, and a legacy prod/<customer> push.
  3. State clearly what was not run in GitLab.

6. Required settings

GitLab group or project variables:

Variable Purpose
NEXUS_USER, NEXUS_PASSWORD Push and pull images and packages
CI_PUSH_TOKEN Write newTag to the iac repo
IBC_IAC_TOKEN, HOTEL_IAC_TOKEN, JASTV_IAC_TOKEN, TICKETING_IAC_TOKEN Deploy to each customer's iac repo

Signing variables are covered in the Security guide.

Repository settings:

  • Protect branches staging, main and prod/*, and the tag pattern v* (Maintainers). Tag pipelines only read protected variables when the tag is protected.
  • Merge method: merge commit. Never squash or rebase release merges.
  • Never print or commit secrets. Keep .env gitignored and share only key names, not values.

7. Troubleshooting

Symptom Likely cause Fix
Tag pipeline cannot read variables Tag pattern v* is not protected Protect the tag pattern
Tag pipeline has no staging image to promote Tag was put on the merge commit, or the image was cleaned up Tag the newest staging commit, and release the same day
deploy:<customer> stops without writing Overlay guard: customer not switched yet Follow "Switching a customer to the shared image" in section 4
Wrong version released Tag already pushed Never move the tag. Release the next patch

8. Open tasks

  • Finish and commit the containerization of the broker service (Dockerfile, CI, deploy files, tests).
  • Commit the pending docs for the pilot project.
  • Switch the remaining customers (hotel, jastv, ticketing) from legacy prod/<customer> branches to the shared image, then remove the legacy flow.