Jenkinsfile fix

This commit is contained in:
Juan Ferrer 2019-01-11 14:01:02 +01:00
parent bd90f302bf
commit b8b78f9517
1 changed files with 22 additions and 22 deletions

44
Jenkinsfile vendored
View File

@ -10,30 +10,30 @@ pipeline {
TAG = "${env.BRANCH_NAME}" TAG = "${env.BRANCH_NAME}"
} }
stages { stages {
stage ('Checkout') { script {
script { env.COMPOSE_PROJECT_NAME = env.JOB_NAME.replace('/', '-');
env.COMPOSE_PROJECT_NAME = env.JOB_NAME.replace('/', '-');
switch (env.BRANCH_NAME) { switch (env.BRANCH_NAME) {
case 'master': case 'master':
env.PORT = 5002 env.PORT = 5002
break; break;
case 'test': case 'test':
env.PORT = 5001 env.PORT = 5001
break; break;
}
switch (env.BRANCH_NAME) {
case 'master':
env.NODE_ENV = 'production'
break;
case 'test':
env.NODE_ENV = 'test'
break;
case 'dev':
env.NODE_ENV = 'development'
break;
}
} }
switch (env.BRANCH_NAME) {
case 'master':
env.NODE_ENV = 'production'
break;
case 'test':
env.NODE_ENV = 'test'
break;
case 'dev':
env.NODE_ENV = 'development'
break;
}
}
stage ('Checkout') {
checkout scm checkout scm
script { script {
env.GIT_COMMITTER_EMAIL = sh( env.GIT_COMMITTER_EMAIL = sh(