Reputation: 441
I have 2 pipelines on gitlab CI, and i want to add a dependency on them. That is, when the first pipeline completes without errors, execute the other.
About pipeline 2:
needs to be executed once or twice a day
needs to be triggered after successful build of Pipeline 1
Any clues on how to achieve this on the gitlab-ci file?
Upvotes: 0
Views: 351
Reputation: 258
Something like that
stages:
- lint
- test
lint:
stage: lint
script:
- echo "lint"
test:
stage: test
script:
- echo "test"
Upvotes: 0
Reputation: 6259
You can schedule your pipeline by configuring the interval in the UI.
In your .gitlab-ci.yml
, you can trigger job only if the schedule is triggered using the keyword only:
or on the contrary bypass job if the scheduled is triggered using except:
keyword
If you gitlab version is at least 11.8 and you have a premium account, you can specify a downstream pipeline using the trigger:
keyword by specifiying a project name and a branch name.
Otherwise, you can link jobs (not pipeline) using needs:
keyword. Depending job will run as soon as the parent job finishes.
Upvotes: 1