diff --git a/Jenkinsfile b/Jenkinsfile index a1341dc98..56e33f4ae 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -9,25 +9,6 @@ node { stage('Setup') { env.NODE_ENV = 'dev' - configFileProvider([ - configFile(fileId: 'salix.properties', - variable: 'PROPS_FILE') - ]) { - def props = readProperties file: PROPS_FILE - env.DEBUG = props.DEBUG - } - - if (PROTECTED_BRANCH) { - configFileProvider([ - configFile(fileId: "salix.branch.${env.BRANCH_NAME}", - variable: 'BRANCH_PROPS_FILE') - ]) { - def props = readProperties file: BRANCH_PROPS_FILE - env.BACK_REPLICAS = props.BACK_REPLICAS - env.NODE_ENV = props.NODE_ENV - } - } - PROTECTED_BRANCH = [ 'dev', 'test', @@ -39,10 +20,28 @@ node { RUN_BUILD = PROTECTED_BRANCH && FROM_GIT // https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables - echo "Node: ${NODE_NAME}" - echo "Workspace: ${WORKSPACE}" - echo "Debug: ${env.DEBUG}" - echo "Replicas: ${env.BACK_REPLICAS}" + echo "NODE_NAME: ${env.NODE_NAME}" + echo "WORKSPACE: ${env.WORKSPACE}" + + configFileProvider([ + configFile(fileId: 'salix.properties', + variable: 'PROPS_FILE') + ]) { + def props = readProperties file: PROPS_FILE + props.each {key, value -> env."${key}" = value } + props.each {key, value -> echo "${key}: ${value}" } + } + + if (PROTECTED_BRANCH) { + configFileProvider([ + configFile(fileId: "salix.branch.${env.BRANCH_NAME}", + variable: 'BRANCH_PROPS_FILE') + ]) { + def props = readProperties file: BRANCH_PROPS_FILE + props.each {key, value -> env."${key}" = value } + props.each {key, value -> echo "${key}: ${value}" } + } + } } } pipeline {