Ricardo Daniel
Ricardo Daniel

Reputation: 441

GitlabCI : trigger pipeline

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:

Any clues on how to achieve this on the gitlab-ci file?

Upvotes: 0

Views: 351

Answers (2)

PHPoenX
PHPoenX

Reputation: 258

Something like that

stages:
    - lint
    - test

lint:
    stage: lint
    script:
        - echo "lint"

test:
    stage: test
    script:
        - echo "test"

Upvotes: 0

Nicolas Pepinster
Nicolas Pepinster

Reputation: 6259

For scheduling

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

For pipeline link

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

Related Questions