Commit 1cb91081 authored by Marcel Amirault's avatar Marcel Amirault

Merge branch 'docs-known-limitation-array-variables' into 'master'

Docs: workaround lack of multiple value variables

See merge request gitlab-org/gitlab!69148
parents b0e75d46 6235b031
......@@ -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
......
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