refs #6797 feat(jenkins) deploy dev-lilium
gitea/salix-front/pipeline/head There was a failure building this commit
Details
gitea/salix-front/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
64b2d8e169
commit
6afb9ed570
|
@ -2,30 +2,46 @@
|
||||||
|
|
||||||
def PROTECTED_BRANCH
|
def PROTECTED_BRANCH
|
||||||
|
|
||||||
pre: {
|
def BRANCH_ENV = [
|
||||||
switch (env.BRANCH_NAME) {
|
test: 'test',
|
||||||
case 'test':
|
master: 'production'
|
||||||
env.NODE_ENV = 'test'
|
]
|
||||||
env.BACK_REPLICAS = 2
|
|
||||||
break
|
node {
|
||||||
case 'master':
|
stage('Setup') {
|
||||||
env.NODE_ENV = 'production'
|
env.BACK_REPLICAS = 1
|
||||||
env.BACK_REPLICAS = 4
|
env.NODE_ENV = BRANCH_ENV[env.BRANCH_NAME] ?: 'dev'
|
||||||
break
|
|
||||||
default:
|
PROTECTED_BRANCH = [
|
||||||
env.NODE_ENV = 'dev'
|
'dev',
|
||||||
env.BACK_REPLICAS = 1
|
'test',
|
||||||
|
'master'
|
||||||
|
].contains(env.BRANCH_NAME)
|
||||||
|
|
||||||
|
// https://www.jenkins.io/doc/book/pipeline/jenkinsfile/#using-environment-variables
|
||||||
|
echo "NODE_NAME: ${env.NODE_NAME}"
|
||||||
|
echo "WORKSPACE: ${env.WORKSPACE}"
|
||||||
|
|
||||||
|
configFileProvider([
|
||||||
|
configFile(fileId: 'salix-front.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-front.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}" }
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PROTECTED_BRANCH = [
|
|
||||||
'dev',
|
|
||||||
'test',
|
|
||||||
'master'
|
|
||||||
].contains(env.BRANCH_NAME)
|
|
||||||
|
|
||||||
// Uncomment to enable debugging
|
|
||||||
// https://loopback.io/doc/en/lb3/Setting-debug-strings.html#debug-strings-reference
|
|
||||||
//env.DEBUG = 'strong-remoting:shared-method'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
|
|
Loading…
Reference in New Issue