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

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -