Deploy fixes

This commit is contained in:
Juan Ferrer 2019-01-08 15:54:02 +01:00
parent 8915bd1304
commit ac6a2be13e
1 changed files with 15 additions and 15 deletions

30
Jenkinsfile vendored
View File

@ -1,13 +1,25 @@
#!/usr/bin/env groovy #!/usr/bin/env groovy
try { try {
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;
}
node { node {
stage ('Checkout') { stage ('Checkout') {
checkout scm checkout scm
} }
stage ('Install') { stage ('Install') {
nodejs('node-lts') { nodejs('node-lts') {
sh "npm install --no-audit" sh "env NODE_ENV= npm install --no-audit"
sh "gulp install" sh "gulp install"
} }
} }
@ -18,18 +30,6 @@ try {
} }
stage ('Deploy') { stage ('Deploy') {
withCredentials([dockerCert(credentialsId: 'docker', variable: 'DOCKER_CERT_PATH')]) { withCredentials([dockerCert(credentialsId: 'docker', variable: 'DOCKER_CERT_PATH')]) {
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) { switch (env.BRANCH_NAME) {
case 'master': case 'master':
env.PORT = 5000 env.PORT = 5000
@ -53,7 +53,7 @@ try {
} }
} }
mail to: 'salix@verdnatura.es', subject: 'Pipeline', "Pipeline success: ${env.JOB_NAME}" mail(to: 'salix@verdnatura.es', subject: 'Pipeline', "Pipeline success: ${env.JOB_NAME}")
} catch(e) { } catch(e) {
mail to: 'salix@verdnatura.es', subject: 'Pipeline', "Pipeline failed: ${env.JOB_NAME}" mail(to: 'salix@verdnatura.es', subject: 'Pipeline', "Pipeline failed: ${env.JOB_NAME}")
} }