Deploy fixes

This commit is contained in:
Juan Ferrer 2019-01-08 13:14:18 +01:00
parent e016ad4d93
commit e5f4e8a01a
1 changed files with 12 additions and 12 deletions

12
Jenkinsfile vendored
View File

@ -17,10 +17,6 @@ node {
} }
stage ('Docker deployment') { stage ('Docker deployment') {
withCredentials([dockerCert(credentialsId: 'docker', variable: 'DOCKER_CERT_PATH')]) { withCredentials([dockerCert(credentialsId: 'docker', variable: 'DOCKER_CERT_PATH')]) {
if (env.BRANCH_NAME != 'master') {
env.COMPOSE_PROJECT_NAME = "${env.BRANCH_NAME}-${env.JOB_NAME}"
}
switch (env.BRANCH_NAME) { switch (env.BRANCH_NAME) {
case 'master': case 'master':
env.NODE_ENV = 'production' env.NODE_ENV = 'production'
@ -42,10 +38,14 @@ node {
break; break;
} }
env.COMPOSE_PROJECT_NAME = env.JOB_NAME env.COMPOSE_PROJECT_NAME = env.JOB_BASE_NAME
env.DOCKER_TLS_VERIFY = 1 env.DOCKER_TLS_VERIFY = 1
env.TAG = env.NODE_ENV env.TAG = env.NODE_ENV
if (env.BRANCH_NAME != 'master') {
env.COMPOSE_PROJECT_NAME = "${env.BRANCH_NAME}-${env.COMPOSE_PROJECT_NAME}"
}
env.DOCKER_HOST = 'tcp://vch1.verdnatura.es:2376'; env.DOCKER_HOST = 'tcp://vch1.verdnatura.es:2376';
sh "docker-compose up --build -d" sh "docker-compose up --build -d"
@ -53,7 +53,6 @@ node {
sh "docker-compose up --build -d" sh "docker-compose up --build -d"
} }
} }
}
post { post {
always { always {
mail to: 'salix@verdnatura.es', subject: 'Pipeline', "Pipeline success: ${env.JOB_NAME}" mail to: 'salix@verdnatura.es', subject: 'Pipeline', "Pipeline success: ${env.JOB_NAME}"
@ -62,3 +61,4 @@ post {
mail to: 'salix@verdnatura.es', subject: 'Pipeline', "Pipeline failed: ${env.JOB_NAME}" mail to: 'salix@verdnatura.es', subject: 'Pipeline', "Pipeline failed: ${env.JOB_NAME}"
} }
} }
}