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 - Knockout pushing observable and computed data to an observable array -

Trouble making a JSON string -

sitecore - Resolve ISitecoreService using SimpleInjector -