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;
}
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}"
}
}