[go: up one dir, main page]

Normalize tag

Normalize the tag part in DOCKER_SNAPSHOT_IMAGE and DOCKER_RELEASE_IMAGE to allow using variables containing forbidden chars (ex: use $CI_COMMIT_REF_NAME as image tag)

According to official documentation:

A tag name must be valid ASCII and may contain lowercase and uppercase letters, digits, underscores, periods and dashes. A tag name may not start with a period or a dash and may contain a maximum of 128 characters.

This issue could be probably implemented with the following function:

# replace illegal chars by a dash
function normalize_tag() {
  echo ${1//[^a-zA-Z0-9_\.-]/-}
}
Edited by Pierre Smeyers