summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzegorz@gitlab.com>2019-01-07 09:19:36 +0000
committerGrzegorz Bizon <grzegorz@gitlab.com>2019-01-07 09:19:36 +0000
commit604073ffc38f938e36f613c592c444d56c99f49c (patch)
treea741c7e6bb3dd9d189be82c7f4c0e8147f19dd89 /doc
parent301315f3b3e5ffe43c3de1f7f15e4e3a307c0912 (diff)
parentc4d615c9dcba6815d0e9d1b7b7de5b7528ac7c72 (diff)
downloadgitlab-ce-604073ffc38f938e36f613c592c444d56c99f49c.tar.gz
Merge branch 'include-project' into 'master'
Allow to include another project files Closes #53903 See merge request gitlab-org/gitlab-ce!24101
Diffstat (limited to 'doc')
-rw-r--r--doc/ci/yaml/README.md30
1 files changed, 28 insertions, 2 deletions
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md
index fe09af24fa3..98542c7e82c 100644
--- a/doc/ci/yaml/README.md
+++ b/doc/ci/yaml/README.md
@@ -1649,7 +1649,7 @@ test:
> Behaviour expanded in GitLab 10.8 to allow more flexible overriding.
> [Moved](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21603)
to GitLab Core in 11.4
-> In GitLab 11.7, support for including [GitLab-supplied templates](https://gitlab.com/gitlab-org/gitlab-ce/tree/master/lib/gitlab/ci/templates) directly [was added](https://gitlab.com/gitlab-org/gitlab-ce/issues/53445).
+> In GitLab 11.7, support for [including GitLab-supplied templates directly](https://gitlab.com/gitlab-org/gitlab-ce/issues/53445) and support for [including templates from another repository](https://gitlab.com/gitlab-org/gitlab-ce/issues/53903) was added.
Using the `include` keyword, you can allow the inclusion of external YAML files.
@@ -1724,7 +1724,7 @@ include:
---
-`include` supports three types of files:
+`include` supports four types of files:
- **local** to the same repository, referenced by using full paths in the same
repository, with `/` being the root directory. For example:
@@ -1750,6 +1750,32 @@ include:
NOTE: **Note:**
We don't support the inclusion of local files through Git submodules paths.
+- **file** from another repository, referenced by using full paths in the same
+ repository, with `/` being the root directory. For example:
+
+ ```yaml
+ include:
+ project: 'my-group/my-project'
+ file: '/templates/.gitlab-ci-template.yml'
+ ```
+
+ You can also specify `ref:`. The default `ref:` is the `HEAD` of the project:
+
+ ```yaml
+ include:
+ - project: 'my-group/my-project'
+ ref: master
+ file: '/templates/.gitlab-ci-template.yml'
+
+ - project: 'my-group/my-project'
+ ref: v1.0.0
+ file: '/templates/.gitlab-ci-template.yml'
+
+ - project: 'my-group/my-project'
+ ref: 787123b47f14b552955ca2786bc9542ae66fee5b # git sha
+ file: '/templates/.gitlab-ci-template.yml'
+ ```
+
- **remote** in a different location, accessed using HTTP/HTTPS, referenced
using the full URL. For example: