Jenkinsfile now uses latest docker tag

This commit is contained in:
Juan 2018-04-27 13:31:12 +02:00
parent 64cf636f90
commit 11b40ae046
1 changed files with 15 additions and 21 deletions

34
Jenkinsfile vendored
View File

@ -2,12 +2,11 @@
def branchName = "${env.BRANCH_NAME}";
// TODO: We are using latest tag until image rotation it's implemented
env.TAG = "latest" /* "${env.BUILD_NUMBER}" */;
env.BRANCH_NAME = branchName;
env.TAG = "${env.BUILD_NUMBER}";
env.salixUser="${env.salixUser}";
env.salixPassword="${env.salixPassword}";
env.salixHost = "${env.productionSalixHost}";
env.salixPort = "${env.productionSalixPort}";
switch (branchName) {
case "test":
@ -17,7 +16,9 @@ switch (branchName) {
break;
case "master":
env.NODE_ENV = "production"
env.DOCKER_HOST = "tcp://172.16.255.29:2375";
env.salixHost = "${env.productionSalixHost}";
env.salixPort = "${env.productionSalixPort}";
env.DOCKER_HOST = "tcp://vch1.verdnatura.es:2375";
break;
}
@ -28,26 +29,19 @@ node {
stage ('Checkout') {
checkout scm
}
stage ('install modules') {
stage ('Install client Node dependencies') {
sh "npm install"
}
stage ('build Project') {
sh "gulp build"
}
stage ("docker") {
stage ("install modules loopback service") {
sh "cd ./services/loopback && npm install"
}
stage ("Stopping/Removing Docker") {
stage ("Removing old dockers") {
sh "docker-compose down --rmi 'all'"
}
stage ("Generar dockers") {
stage ('Build project') {
sh "gulp build"
}
stage ("Install services Node dependencies") {
sh "cd ./services/loopback && npm install"
}
stage ("Generating new dockers") {
sh "docker-compose up -d --build"
}
}
}