8

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

14

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'
Sign up to request clarification or add additional context in comments.

2 Comments

Thank you. But I get a syntax error jobs:include config should be a hash with GitLab Community Edition 11.1.1 94b9323
Ah, you'll need to update your GitLab instance. For the original include syntax on GitLab CE, you'll need GitLab 11.4 or later. And, the newer include:local syntax requires GitLab 11.7 or later.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.