0

We are using GitLab Enterprise Edition 10.8.7-ee 075705a and trying to use Gitlab CI.

Here is my scenario:- I've two repositories repo1 and repo2 and I'm setting up two pipelines pipeline1 and pipeline2.

Now I'm looking for an option where I can configure pipeline2 to trigger a build if pipeline1 build is successful. One more thing, I need to get the version number of the pipeline1 in pipeline2

Note:- I know we can trigger pipeline2 from pipeline1 but I need other way around.

Please suggest.

Raj
  • 1,467
  • 3
  • 23
  • 51

1 Answers1

0

A couple of options. Use the gitlab api to do this (triggers). Use webhooks to do this.

gitlab webhooks docs
gitlab triggers docs

with this. you can get any data / meta data for your stack. and can automagically call it/set it on any condition. This can also be done if your stack is using aws (CLI) and (or) Jenkins

Some sections that may interest you in gitlab triggers docs

  • When used with multi-project Pipelines
  • When a pipeline depends on the artifacts of another Pipeline
  • Triggering a pipeline from a webhook
  • Using cron to trigger nightly (or pretty much *ly) pipelines
Timetrax
  • 1,373
  • 13
  • 15
  • Thanks for the response. I believe the gitlab wehooks are per repo but I need branch level triggering. For 'gitlab triggers', at a high level, I believe it useful when I want to trigger a pipeline2 from pipeline1. I'll deep dive into this. Thanks – Raj Jan 24 '19 at 19:39
  • Check out gitlab branching webhooks https://stackoverflow.com/questions/42992224/webhooks-for-branching-in-gitlab Follow this gitlab proposal https://gitlab.com/gitlab-org/gitlab-ce/issues/20338 – Timetrax Jan 29 '19 at 17:45