Skip to content

20868 - Includes External Files in Gitlab CI YML

What does this MR do?

Enables include keyword on gitlab-ci.yml, allowing the inclusion of external files resulting in a composed file that is evaluated as a single one

The external files can be:

  • local to the same repository, referenced using the path
  • remote in a different location, accessed using HTTP(S) protocol, referenced using the full URL

The include keyword supports a single local/remote value or an array of multiple local/remote values:

Examples:

include: '/templates/.gitlab-ci-templates.yml'
include: 'https://gitlab.com/gitlab-org/gitlab-ce/blob/8efdf75b/.gitlab-ci-templates.yml'
include:
 - '/templates/.gitlab-ci-templates-1.yml'
 - '/templates/.gitlab-ci-templates-2.yml'
 - 'https://gitlab.com/gitlab-org/gitlab-ce/blob/8efdf75b/.gitlab-ci-templates.yml'

Are there points in the code the reviewer needs to double check?

  • Double check if the current implementation covers all the possible scenarios

Why was this MR needed?

To make gitlab-ci.yml structure restful

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #20868

Edited by Mayra Cabrera

Merge request reports