feat(deploy): add --version flag for image version pinning#15
Conversation
Allows pinning all DCM service images to a specific version tag via --version (main, explicit tag, or 'release' to auto-resolve from Quay.io). Auto-derives api-gateway branch from the version unless explicitly set. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Chad Crum <chadcrum@users.noreply.github.com>
testetson22
left a comment
There was a problem hiding this comment.
Could add a dependency check for jq, but it's no biggie.
|
jq is already in the prereq check — |
| # --- Version resolution ---------------------------------------------------- # | ||
|
|
||
| resolve_latest_version() { | ||
| local api_url="https://quay.io/api/v1/repository/dcm-project/${QUAY_VERSION_REPO}/tag/?onlyActiveTags=true&limit=100" |
There was a problem hiding this comment.
Since the CI builds new images for every push to main, getting to more than 100 tags is not too far (the Catalog Manager is already 49).
The quay api support another filter: filter_tag_name. However, it does not support regex. So, using it will not remove the need to filter using grep. But, it will reduce the array you get back from the API.
So, it can be:
| local api_url="https://quay.io/api/v1/repository/dcm-project/${QUAY_VERSION_REPO}/tag/?onlyActiveTags=true&limit=100" | |
| local api_url="https://quay.io/api/v1/repository/dcm-project/${QUAY_VERSION_REPO}/tag/?onlyActiveTags=true&limit=100&filter_tag_name=like:v%" |
There was a problem hiding this comment.
Opened #16 for this — adds filter_tag_name=like:v% to the query in resolve_latest_version().
Summary
--versionflag todeploy-dcm.sh— pin all DCM service images tomain, an explicit tag (e.g.v0.1.0-rc.1), orrelease(auto-resolves latest semver from Quay.io)--api-gateway-branchto the matching release branch (e.g.v0.1.0-rc.1→release/v0.1.0) unless explicitly set via flag or env varVERSION_ENV_VARSarray constant for maintainabilityTest plan
--version release— resolves tag from Quay, derives branch, all health checks pass--version v0.1.0-rc.1— explicit tag, correct branch derivation, all health checks pass--version main— no branch derivation, clones main, all health checks pass--api-gateway-branchoverride respected (both CLI flag and env var)--helpoutput includes--versionandDCM_VERSION🤖 Generated with Claude Code