0

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.

  • Pipeline 1 : unit test, lint + build
  • Pipeline 2: run automated tests

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?

Ricardo Daniel
  • 421
  • 7
  • 15

2 Answers2

1

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.

Nicolas Pepinster
  • 5,413
  • 2
  • 30
  • 48
0

Something like that

stages:
    - lint
    - test

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

test:
    stage: test
    script:
        - echo "test"
PHPoenX
  • 248
  • 1
  • 9