wrap setting the env var in a script wrapper

pull/15/head
Adam Townsend 2023-10-06 18:35:00 -07:00
parent e720761106
commit 2448c93fa7
1 changed files with 3 additions and 1 deletions

2
Jenkinsfile vendored
View File

@ -9,7 +9,9 @@ pipeline {
stage('Init') {
steps {
sh 'rbenv local 3.2.2'
script {
env.APP_SESSION_SECRET = sh(script: 'ruby secret.rb', returnStdout: true)
}
sh 'echo "ENV[\\\"APP_SESSION_SECRET\\\"] ||= $(ruby secret.rb)" > .env.rb'
sh 'echo "ENV[\\\"DB_NAME\\\"] ||= \\\"${DB_NAME}\\\"" >> .env.rb'
sh 'cat .env.rb'