diff options
author | Grzegorz Bizon <grzegorz@gitlab.com> | 2019-05-28 20:08:04 +0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2019-05-28 20:08:04 +0300 |
commit | d9f871f1d62466d8af794430355231c53e7df29f (patch) | |
tree | e2946efc731782a962b83bb7885c475e6530e517 /doc | |
parent | 1215a3f1adceba23e49b0d1d850bde2cf07cd9d4 (diff) |
Docs for a downstream pipeline variables expansion
Diffstat (limited to 'doc')
-rw-r--r-- | doc/ci/multi_project_pipelines.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/ci/multi_project_pipelines.md b/doc/ci/multi_project_pipelines.md index 556059c01b6..e9deabf27f8 100644 --- a/doc/ci/multi_project_pipelines.md +++ b/doc/ci/multi_project_pipelines.md @@ -134,6 +134,34 @@ staging: The `ENVIRONMENT` variable will be passed to every job defined in a downstream pipeline. It will be available as an environment variable when GitLab Runner picks a job. +In the following configuration, the `MY_VARIABLE` variable will be passed +downstream, because jobs inherit variables declared in top-level `variables`: + +```yaml +variables: + MY_VARIABLE: my-value + +my-pipeline: + variables: + ENVIRONMENT: something + trigger: my/project +``` + +You might want to pass some information about the upstream pipeline using, for +example, predefined variables. In order to do that, you can use interpolation +to pass any variable. For example: + +```yaml +my-pipeline: + variables: + UPSTREAM_BRANCH: $CI_COMMIT_REF_NAME + trigger: my/project +``` + +In this scenario, the `UPSTREAM_BRANCH` variable with a value related to the +upstream pipeline will be passed to a `downstream` job, and will be available +within the context of all downstream builds. + ### Limitations Because bridge jobs are a little different to regular jobs, it is not |