Remove v prefix from generated version numbers to stop things breaking and keep with Docker conventions

This commit is contained in:
akp 2024-05-12 15:47:23 +01:00
parent cb4844181b
commit 3a270cf02a
No known key found for this signature in database
GPG key ID: CF8D58F3DEB20755
2 changed files with 2 additions and 1 deletions

View file

@ -16,5 +16,5 @@ buildAndPush:
- "echo $CI_REGISTRY_PASSWORD | docker login $CI_REGISTRY --username $CI_REGISTRY_USER --password-stdin"
- "docker info"
script:
- "docker build . --file Dockerfile --tag ${CI_REGISTRY_IMAGE}:latest --tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG}"
- "docker build . --file Dockerfile --tag ${CI_REGISTRY_IMAGE}:latest --tag ${CI_REGISTRY_IMAGE}:${CI_COMMIT_TAG#'v'}" # that weird thing #'v' thing strips a prefix of v
- "docker push --all-tags $CI_REGISTRY_IMAGE"

View file

@ -2,6 +2,7 @@
import sys
VERSION = sys.argv[1]
VERSION = VERSION[1:] if VERSION.lower().startswith("v") else VERSION
def do_substitution(input_filename: str, output_filename: str):
with open(input_filename) as f: