Is there a way to execute a stage just once, only the first time that the pipeline is executed
For example, if I have this stages
I wanna execute N pipelines but without execute 'tag_version' the next times, just execute it at the first time
You can use rules: changes
, maybe combined with when: manual
, so that the tag is executed only when a specific file is changed (say, the Dockerfile).
I solved using the following rule, catching the push event and matching with my tag that I wanna tag. In this way my stage is executed once
.mycondition: &mycondition
rules:
- if: '$CI_COMMIT_TAG =~ /^release-v\d+$/ && $CI_PIPELINE_SOURCE == "push"'
when: always
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.