Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gitlab pipeline on sub projects

Suppose main project has sub-projects

MainProject/
       \-------- android
                   \-------- .gitlab-ci-android.yml
       \-------- ios
       \-------- lib
       \-------- .gitlab-ci.yml

I want my .gitlab-ci.yml to run parallel jobs for each subfolder. My goal is to have separate .gitlab-ci.yml files. Yes, it looks messy to touch only one file when you have to configure the CI of a few projects.

What is the exact command line to run jobs from the main .gitlab-ci.yml?

I tried with , but not working

jobAndroid:
  script: "gitlab-runner exec android/.gitlab-ci-android.yml"
like image 564
Raymond Chenon Avatar asked Mar 13 '19 16:03

Raymond Chenon


People also ask

How do I trigger a GitLab pipeline from another project?

Go to Settings → CI/CD → Pipeline triggers → Add Trigger . It will create a trigger with a TOKEN string, which then can be copied into the curl command of gitlab-ci. yml of project A. Note: The triggers under only is necessary to define the rules.

Can a GitLab project have multiple pipelines?

You can set up GitLab CI/CD across multiple projects, so that a pipeline in one project can trigger a pipeline in another project. You can visualize the entire pipeline in one place, including all cross-project interdependencies.

Can a GitLab project have multiple repositories?

One Solution: Gitlab supports the creation of groups of projects/repos, which can be managed as a project consisting of multiple repos.

Why did GitLab pipeline fail?

A team's build environment or servers could have problems, causing a failed pipeline. That's a key reason why GitLab believes ephemeral builds are important, Brendan says. Ephemeral builds are reproducible meaning they're going to not be impacted because the server went down.


1 Answers

You can use the include:local syntax for this. Include the CI files from your subfolders in your main .gitlab-ci.yml file.

include:
  - local: '/android/.gitlab-ci-android.yml'
like image 182
King Chung Huang Avatar answered Dec 07 '22 19:12

King Chung Huang