build - Is it possible to set a top-level only/except in a .gitlab-ci.yml file? -
i have 3 stages in ci file, have only/except this:
test: only: - tags except: - branches script: - npm run test seems redundant have only/except in 3 places. there way set @ top level of script config? don't see in docs.
you can use map merging feature: https://docs.gitlab.com/ee/ci/yaml/#special-yaml-features
.job_template: &job_definition only: - tags except: - branches test1: <<: *job_definition script: - npm run test test2: <<: *job_definition script: - # ...
Comments
Post a Comment