diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-07 04:02:14 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-09-07 04:02:14 +0300 |
commit | ff97077fc8908cc231d967aa7e7133198172b326 (patch) | |
tree | 32fed88d6b33b8cfd903a44ddf702e2b99e4e346 /doc/ci/variables | |
parent | 183b71521834f47fe2777085ccf001485b546285 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/ci/variables')
-rw-r--r-- | doc/ci/variables/index.md | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/ci/variables/index.md b/doc/ci/variables/index.md index 7b909cf15f8..dde3981d85e 100644 --- a/doc/ci/variables/index.md +++ b/doc/ci/variables/index.md @@ -304,6 +304,26 @@ echo "$KUBE_CA_PEM" > "$(pwd)/kube.ca.pem" kubectl config set-cluster e2e --server="$KUBE_URL" --certificate-authority="$(pwd)/kube.ca.pem" ``` +#### Store multiple values in one variable + +It is not possible to create a CI/CD variable that is an array of values, but you +can use shell scripting techniques for similar behavior. + +For example, you can store multiple variables separated by a space in a variable, +then loop through the values with a script: + +```yaml +job1: + variables: + FOLDERS: src test docs + script: + - | + for FOLDER in $FOLDERS + do + echo "The path is root/${FOLDER}" + done +``` + ### Mask a CI/CD variable > [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/13784) in GitLab 11.10 |