6
votes

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"
1

1 Answers

12
votes

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'