CNB Auto Docker Tag Plugin - Automatically manage Docker image tag version numbers.
The plugin supports the following tag format templates:
tagFormat: "v@{version}"
Examples: v1.0.1, v1.0.2, v1.1.0
Version increment rules:
v1.0.1Examples:
v1.0.1 → v1.0.2v1.0.99 → v1.1.0v1.99.99 → v2.0.0tagFormat: "v@{auto}"
Examples: v1, v2, v3
Version increment rules:
v1tagFormat: "@{yyyyMMdd}-v@{version}"
Examples: 20260325-v1.0.1
tagFormat: "@{yyyyMMdd}-v@{auto}"
Examples: 20260325-v1
Date handling rules:
@{yyyyMMdd} will be replaced with the current date (e.g., 20260325)Use in .cnb.yml pipeline configuration:
stages:
- name: auto-docker-tag
image: docker.cnb.cool/r_r/auto-docker-tag:latest
settings:
tagFormat: "v@{version}"
stringCNB_REPO_SLUG_LOWERCASE)Example:
stages:
- name: auto-docker-tag
image: docker.cnb.cool/r_r/auto-docker-tag:latest
settings:
slug: "other-owner/other-repo"
stringdockerdocker.stringCNB_REPO_SLUG_LOWERCASE)Example:
stages:
- name: auto-docker-tag
image: docker.cnb.cool/r_r/auto-docker-tag:latest
settings:
imageName: "my-custom-image"
stringv@{version}@{version}, @{auto}, @{yyyyMMdd} placeholders.Example:
stages:
- name: auto-docker-tag
image: docker.cnb.cool/r_r/auto-docker-tag:latest
settings:
tagFormat: "@{yyyyMMdd}-v@{version}"
stringCNB_API_ENDPOINT)https://api.cnb.cool.stringCNB_TOKEN)The following pipeline variables will be output:
##[set-output auto-docker-tag=v1.0.1]
##[set-output auto-docker-tag-url=docker.cnb.cool/h_h/images/aws-freetier-monitor:v1.0.1]
main:
push:
- stages:
- name: auto-docker-tag
image: docker.cnb.cool/r_r/auto-docker-tag:latest
settings:
tagFormat: "v@{version}"
auto-docker-tag: DOCKER_TAG
auto-docker-tag-url: DOCKER_TAG_URL
- name: echo env
script:
- echo "DOCKER_TAG $DOCKER_TAG"
- echo "DOCKER_TAG_URL $DOCKER_TAG_URL"
main:
push:
- stages:
- name: auto-docker-tag
image: docker.cnb.cool/r_r/auto-docker-tag:latest
settings:
tagFormat: "@{yyyyMMdd}-v@{auto}"
main:
push:
- stages:
- name: auto-docker-tag-other-repo
image: docker.cnb.cool/r_r/auto-docker-tag:latest
settings:
slug: "other-owner/other-repo"
imageName: "my-image"
endpoint: "https://api.cnb.cool"
token: "${OTHER_REPO_TOKEN}"
The plugin will exit with a non-zero status code, causing the pipeline to fail, in the following cases:
MIT License