Skip to content

feat(deploy): add --version flag for image version pinning#15

Merged
chadcrum merged 1 commit into
dcm-project:mainfrom
chadcrum:flpath-4162-add-version-flag
May 6, 2026
Merged

feat(deploy): add --version flag for image version pinning#15
chadcrum merged 1 commit into
dcm-project:mainfrom
chadcrum:flpath-4162-add-version-flag

Conversation

@chadcrum
Copy link
Copy Markdown
Contributor

@chadcrum chadcrum commented May 5, 2026

Summary

  • Adds --version flag to deploy-dcm.sh — pin all DCM service images to main, an explicit tag (e.g. v0.1.0-rc.1), or release (auto-resolves latest semver from Quay.io)
  • Auto-derives --api-gateway-branch to the matching release branch (e.g. v0.1.0-rc.1release/v0.1.0) unless explicitly set via flag or env var
  • Version env vars stored as a VERSION_ENV_VARS array constant for maintainability

Test 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-branch override respected (both CLI flag and env var)
  • --help output includes --version and DCM_VERSION
  • ShellCheck clean
  • Tested on sealusa12 (full deploy + health check for all three modes)

🤖 Generated with Claude Code

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>
Copy link
Copy Markdown
Contributor

@testetson22 testetson22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could add a dependency check for jq, but it's no biggie.

@chadcrum
Copy link
Copy Markdown
Contributor Author

chadcrum commented May 5, 2026

jq is already in the prereq check — check_required_tools git podman podman-compose curl jq runs before the version block gets touched.

@chadcrum chadcrum merged commit 3f46a7e into dcm-project:main May 6, 2026
4 checks passed
Comment thread scripts/deploy-dcm.sh
# --- Version resolution ---------------------------------------------------- #

resolve_latest_version() {
local api_url="https://quay.io/api/v1/repository/dcm-project/${QUAY_VERSION_REPO}/tag/?onlyActiveTags=true&limit=100"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

Suggested change
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%"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #16 for this — adds filter_tag_name=like:v% to the query in resolve_latest_version().

Comment thread scripts/deploy-dcm.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants