Improving maintainability by combining multiple pipelines and leveraging parent-child pipelines
Most GitLab users simply utilize a single .gitlab-ci.yml
file for their pipelines. This approach is perfectly acceptable, but in many cases, the amount of code inside this file can become very large and difficult to maintain. GitLab has introduced the ability to include multiple gitlab-ci
files together as one. In this section, we’re going to cover how to break up a .gitlab-ci.yml
file into multiple sections. Later, we’re going to cover how to take a second .gitlab-ci.yml
file and execute a second child pipeline, and then discuss the reasons why you may want to do this.
Leveraging includes for maintainability
Create a .gitlab-ci.yml
file that looks like this:
"Build Application": stage: build script: - code here "Build Container": stage: build script: ...