Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
6235b031
Commit
6235b031
authored
Sep 07, 2021
by
Daniel Diniz
Committed by
Marcel Amirault
Sep 07, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Docs: workaround lack of multiple value variables
parent
42679769
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
doc/ci/variables/index.md
doc/ci/variables/index.md
+20
-0
No files found.
doc/ci/variables/index.md
View file @
6235b031
...
@@ -304,6 +304,26 @@ echo "$KUBE_CA_PEM" > "$(pwd)/kube.ca.pem"
...
@@ -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"
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
### Mask a CI/CD variable
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/13784) in GitLab 11.10
> [Introduced](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/13784) in GitLab 11.10
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment