GitLab CI - if variable exists set variable -


i'd set dash plus repo tag docker image build if build build of tag, , neither if not, i'll explain...

this trivial if wanted set tag if existed because work:

build-nginx:   stage: build-nginx   script:     - command docker build -t $ci_registry_image:nginx$ci_commit_tag .     - command docker push $ci_registry_image:nginx$ci_commit_tag 

this create registry.example.com/image:nginx if there no tag , registry.example.com/image:nginx1.0 if there was, how image named registry.example.com/image:nginx-1.0 (with dash), i've have check if tag variable set otherwise i'd end , image called registry.example.com/image:nginx- if tag variable not set.


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -