Deploy fixes

This commit is contained in:
Juan Ferrer 2019-01-11 09:35:26 +01:00
parent 8a035d5fab
commit f529cbb7e9
1 changed files with 17 additions and 17 deletions

34
Jenkinsfile vendored
View File

@ -15,6 +15,19 @@ try {
break; 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 { node {
stage ('Checkout') { stage ('Checkout') {
checkout scm checkout scm
@ -30,21 +43,6 @@ try {
sh "gulp install" sh "gulp install"
sh "gulp build" 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( withCredentials([usernamePassword(
credentialsId: 'docker-registry', credentialsId: 'docker-registry',
@ -56,7 +54,8 @@ try {
sh "docker-compose build --parallel" sh "docker-compose build --parallel"
sh "docker-compose push" sh "docker-compose push"
}
stage ('Deploy') {
withEnv(['DOCKER_TLS_VERIFY=1']) { withEnv(['DOCKER_TLS_VERIFY=1']) {
withCredentials([dockerCert( withCredentials([dockerCert(
credentialsId: 'docker', credentialsId: 'docker',
@ -78,7 +77,8 @@ try {
) )
} }
} }
}
stage ('Cleanup') {
sh "docker logout ${registry}" sh "docker logout ${registry}"
} }
} }