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"
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.
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.
One Solution: Gitlab supports the creation of groups of projects/repos, which can be managed as a project consisting of multiple repos.
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.
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'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With