Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Carlos Ribas
rnacentral-webcode
Commits
d6dfe6ea
Commit
d6dfe6ea
authored
Mar 31, 2021
by
carlosribas
Browse files
Set environment variable based on parameter
parent
69300a77
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
21 deletions
+29
-21
jenkins/wp-kubernetes.jenkinsfile
jenkins/wp-kubernetes.jenkinsfile
+29
-21
No files found.
jenkins/wp-kubernetes.jenkinsfile
View file @
d6dfe6ea
...
...
@@ -26,29 +26,37 @@ pipeline {
}
stages {
stage("deploy") {
environment {
// set DB with the corresponding Secret file
if (params.DATABASE == 'PRO') {
DB = "db-pro"
} else if (params.DATABASE == 'DEV') {
DB = "db-dev"
} else if (params.DATABASE == 'TEST-PG10') {
DB = "db-test"
} else if (params.DATABASE == 'FB-PG10') {
DB = "db-fb"
} else if (params.DATABASE == 'HH-PG10') {
DB = "db-hh"
}
// set RELEASE with the corresponding instance chart
if (params.WEB == 'TEST') {
RELEASE = "full-dev"
} else if (params.WEB == 'PROD') {
RELEASE = "full-prod"
}
}
steps {
script {
// set DB with the corresponding Secret file
switch(params.DATABASE) {
case 'PRO':
env.DB = 'db-pro'
break
case 'DEV':
env.DB = 'db-dev'
break
case 'TEST':
env.DB = 'db-test'
break
case 'FB':
env.DB = 'db-fb'
break
case 'HH':
env.DB = 'db-hh'
break
}
// set RELEASE with the corresponding instance chart
switch(params.WEB) {
case 'TEST':
env.RELEASE = 'full-dev'
break
case 'PROD':
env.RELEASE = 'full-prod'
break
}
if (params.CLUSTER == 'HX') {
withCredentials([file(credentialsId: 'HX-WP-Config', variable: 'config')]) {
sh """
...
...
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