A container to be used in CircleCI. Includes common utilities, such as yq, and docker-compose.
- Pushes to master build :latest
- Tags will build a :$CIRCLE_TAG
- cli utility to update yaml files within CI.
- update the ENV YQ_VERSION in the dockerfile to update
- docker comes from the official github releases
- update the ENV DOCKERVERSION to update
- docker-compose comes from the official github releases
- update the ENV COMPOSE_VERSION to update
Below are the helper scripts packaged in bin/ (used by CircleCI and deployment pipelines). Each entry lists purpose, common usage, and the most important environment variables.
- These scripts are intended to be run inside CI containers and rely on typical CircleCI environment variables (e.g.
CIRCLE_TAG,CIRCLE_SHA1,CIRCLE_BRANCH). - The
ghbinary (GitHub CLI) is bundled so scripts can create PRs/releases without depending on the environment image.
-
build-and-push— Build a Docker image and push one or more tags to the registry.- Key env:
REGISTRY_IMAGE,DOCKER_REGISTRY,DOCKER_LOGIN,DOCKER_PASSWORD,IMAGE_TAG,DOCKERFILE,DOCKER_CONTEXT,BUILD_ARGS. - Behavior: logs into the registry, builds using comma-separated tags from
IMAGE_TAG, and pushes each tag.
- Key env:
-
ci-utils-lib.sh— Small shell library sourced by other scripts.- Exports
slugify_branch()(branch -> safe slug) and other shared helpers. - Usage:
source "$(dirname "$0")/ci-utils-lib.sh".
- Exports
-
gh— GitHub CLI binary included for creating PRs and releases from scripts (used byimage-release-pr,pr-release, etc.). -
image-release-for-clusters— High-level helper to tag images and open release PRs across multiple cluster manifests.- Usage: pass a comma-separated
clusterslist or set envclusters. - Key env:
CONFIG_REPO_NAME/CONFIG_REPO,CIRCLE_PROJECT_REPONAME,FROM_TAG/TO_TAG.
- Usage: pass a comma-separated
-
image-release-pr— Update an ArgoCD Application manifest with a new image tag and create a PR in the config repo.- Usage:
image-release-pr <manifest-path>(e.g.clusters/prod/manifests/myproj/prod.yaml). - Key env:
CONFIG_REPO,GITHUB_USER,GITHUB_TOKEN,CIRCLE_PROJECT_REPONAME,TO_TAG,CIRCLE_SHA1.
- Usage:
-
image-release-pr-singlerepo— Single-repo variant (assets / journal-base): updates chartvalues.yaml, creates a helm release and a PR.- Used where chart and config live in the same repository.
-
image-tag— Create a Harbor tag for an existing artifact (copy by digest).- Key env:
REGISTRY_HOST,HARBOR_PROJECT(default:library),REGISTRY_REPO,DOCKER_USERNAME,DOCKER_PASSWORD,TO_TAG,FROM_TAG(optional) orCIRCLE_BRANCH/CIRCLE_SHA1. - Behavior: constructs a source tag (branch+SHA or provided
FROM_TAG) and creates an immutableTO_TAGvia Harbor API.
- Key env:
-
image-tag-singlerepo— Single-repo tagging helper (assets); newer, more robust variant that can infer the source tag. -
pr-release— Update ArgoCD Application manifest, commit, push, and open a PR (legacy/widely used across projects).- Usage:
pr-release <manifest-path>; usesghto create the PR.
- Usage:
-
pr-release-singlerepo— Older name / singlerepo variant (deprecated in favor ofimage-release-pr-singlerepo). -
slugify-branch— CLI wrapper that converts a branch name into a safe slug for tags.- Usage:
slugify-branch <branch-name>(callsslugify_branchfromci-utils-lib.sh).
- Usage:
-
tag-image— Tag an existing image (manifest copy) without pulling the image.- Key env:
REGISTRY_HOST,REGISTRY_REPO,DOCKER_USERNAME,DOCKER_PASSWORD,CIRCLE_SHA1,CIRCLE_TAG.
- Key env:
-
tag-image-singlerepo— Single-repo variant oftag-image; improved error handling and support forFROM_TAG. -
trivy-check— Run a Trivy vulnerability scan on the image; optionally triggers a rebuild viabuild-and-pushwhen vulnerabilities are found.- Uses
trivy iand will call/usr/local/bin/build-and-pushif scan exit code indicates issues.
- Uses
- Most scripts expect CI-provided env vars — to run locally set the required env vars before invoking the script.
*-singlereposcripts are used where chart/config and code live together (examples:assets,journal-base).pr-release-singlerepoandtag-image-singlerepoare kept for compatibility but are superseded in some pipelines.
If you'd like, I can also add usage examples or a small quick-reference table for each script — tell me which scripts you want examples for.