Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Kubernetes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SmartDataLab
public
CI-CD components
Kubernetes
Commits
bc2f8d58
Commit
bc2f8d58
authored
Jun 19, 2021
by
Pierre Smeyers
Browse files
Options
Downloads
Patches
Plain Diff
feat: support multi-lines environment variables substitution
parent
f5d041f4
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+15
-1
15 additions, 1 deletion
README.md
templates/gitlab-ci-k8s.yml
+1
-1
1 addition, 1 deletion
templates/gitlab-ci-k8s.yml
with
16 additions
and
2 deletions
README.md
+
15
−
1
View file @
bc2f8d58
...
...
@@ -292,7 +292,21 @@ In order to be able to implement some **genericity** in your scripts and templat
*
any
[
GitLab CI variable
](
https://docs.gitlab.com/ee/ci/variables/#predefined-environment-variables
)
(ex:
`${CI_ENVIRONMENT_URL}`
to retrieve the actual environment exposed route)
> :warning: In order to be properly replaced, variables in your YAML descriptors shall be written with curly braces (ex: `${MYVAR}` and not `$MYVAR`).
> :warning:
>
> In order to be properly replaced, variables in your YAML descriptors shall be written with curly braces (ex: `${MYVAR}` and not `$MYVAR`).
>
> Multiline variables must be surrounded by **double quotes** (`"`). Example:
>
> ```yaml
> [...]
> containers:
> - name: restaurant-app
> env:
> # multiline variable
> - name: MENU
> value: "${APP_MENU}"
> ```
## kube-score job
...
...
This diff is collapsed.
Click to expand it.
templates/gitlab-ci-k8s.yml
+
1
−
1
View file @
bc2f8d58
...
...
@@ -236,7 +236,7 @@ stages:
}
function awkenvsubst() {
awk '{while(match($0,"[$]{[^}]*}")) {var=substr($0,RSTART+2,RLENGTH -3);gsub("[$]{"var"}",
ENVIRON[var]
)}}1'
awk '{while(match($0,"[$]{[^}]*}")) {var=substr($0,RSTART+2,RLENGTH -3);
val=ENVIRON[var];gsub(/["\\]/,"\\\\&", val);gsub("\n", "\\n", val);gsub("\r", "\\r", val);
gsub("[$]{"var"}",
val
)}}1'
}
function login() {
...
...
This diff is collapsed.
Click to expand it.
Ghost User
@ghost
mentioned in commit
7083e03b
·
Jun 5, 2024
mentioned in commit
7083e03b
mentioned in commit 7083e03b07ebfa883f30baae515913286b69e8e1
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment