Commit 717f43e3 authored by Evan Read's avatar Evan Read Committed by Achilleas Pipinellis

Edit downstream variable content

parent 5fa1bd60
...@@ -138,14 +138,15 @@ staging: ...@@ -138,14 +138,15 @@ staging:
The `ENVIRONMENT` variable will be passed to every job defined in a downstream 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. 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 In the following configuration, the `MY_VARIABLE` variable will be passed to the downstream pipeline
downstream, because jobs inherit variables declared in top-level `variables`: that is created when the `trigger-downstream` job is queued. This is because `trigger-downstream`
job inherits variables declared in global variables blocks, and then we pass these variables to a downstream pipeline.
```yaml ```yaml
variables: variables:
MY_VARIABLE: my-value MY_VARIABLE: my-value
my-pipeline: trigger-downstream:
variables: variables:
ENVIRONMENT: something ENVIRONMENT: something
trigger: my/project trigger: my/project
...@@ -156,14 +157,14 @@ example, predefined variables. In order to do that, you can use interpolation ...@@ -156,14 +157,14 @@ example, predefined variables. In order to do that, you can use interpolation
to pass any variable. For example: to pass any variable. For example:
```yaml ```yaml
my-pipeline: downstream-job:
variables: variables:
UPSTREAM_BRANCH: $CI_COMMIT_REF_NAME UPSTREAM_BRANCH: $CI_COMMIT_REF_NAME
trigger: my/project trigger: my/project
``` ```
In this scenario, the `UPSTREAM_BRANCH` variable with a value related to the 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 upstream pipeline will be passed to the `downstream-job` job, and will be available
within the context of all downstream builds. within the context of all downstream builds.
### Limitations ### Limitations
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment