mirror of
https://gitlab.com/fdroid/fdroidserver.git
synced 2024-10-05 18:50:09 +02:00
gitlab-ci: sanitize git ref names for use as docker tags
git ref names can contain many chars that are not allowed in docker tags. https://docs.docker.com/engine/reference/commandline/tag/ 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. https://gitlab.com/brandsimon/fdroidserver/-/jobs/3705004274
This commit is contained in:
parent
0cdc2e3f4f
commit
98aa39a597
@ -574,9 +574,10 @@ docker:
|
|||||||
services:
|
services:
|
||||||
- docker:dind
|
- docker:dind
|
||||||
variables:
|
variables:
|
||||||
TEST_IMAGE: $CI_REGISTRY_IMAGE:$CI_BUILD_REF_NAME
|
|
||||||
RELEASE_IMAGE: $CI_REGISTRY_IMAGE:buildserver
|
RELEASE_IMAGE: $CI_REGISTRY_IMAGE:buildserver
|
||||||
script:
|
script:
|
||||||
|
# git ref names can contain many chars that are not allowed in docker tags
|
||||||
|
- export TEST_IMAGE=$CI_REGISTRY_IMAGE:$(printf $CI_BUILD_REF_NAME | sed 's,[^a-zA-Z0-9_.-],_,g')
|
||||||
- cd buildserver
|
- cd buildserver
|
||||||
- docker build -t $TEST_IMAGE --build-arg GIT_REV_PARSE_HEAD=$(git rev-parse HEAD) .
|
- docker build -t $TEST_IMAGE --build-arg GIT_REV_PARSE_HEAD=$(git rev-parse HEAD) .
|
||||||
- docker tag $TEST_IMAGE $RELEASE_IMAGE
|
- docker tag $TEST_IMAGE $RELEASE_IMAGE
|
||||||
|
Loading…
Reference in New Issue
Block a user