From f529cbb7e9ab8693cf96cd5a8b6a518e27fe5100 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Fri, 11 Jan 2019 09:35:26 +0100 Subject: [PATCH] Deploy fixes --- Jenkinsfile | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index f67b9166f..aacb5618a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,6 +15,19 @@ try { break; } + def registry = 'registry.verdnatura.es' + env.COMPOSE_PROJECT_NAME = env.JOB_NAME.replace('/', '-'); + env.TAG = env.BRANCH_NAME + + switch (env.BRANCH_NAME) { + case 'master': + env.PORT = 5002 + break; + case 'test': + env.PORT = 5001 + break; + } + node { stage ('Checkout') { checkout scm @@ -30,21 +43,6 @@ try { sh "gulp install" sh "gulp build" } - } - stage ('Deploy') { - env.COMPOSE_PROJECT_NAME = env.JOB_NAME.replace('/', '-'); - env.TAG = env.BRANCH_NAME - - switch (env.BRANCH_NAME) { - case 'master': - env.PORT = 5002 - break; - case 'test': - env.PORT = 5001 - break; - } - - def registry = 'registry.verdnatura.es' withCredentials([usernamePassword( credentialsId: 'docker-registry', @@ -56,7 +54,8 @@ try { sh "docker-compose build --parallel" sh "docker-compose push" - + } + stage ('Deploy') { withEnv(['DOCKER_TLS_VERIFY=1']) { withCredentials([dockerCert( credentialsId: 'docker', @@ -78,7 +77,8 @@ try { ) } } - + } + stage ('Cleanup') { sh "docker logout ${registry}" } }