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

36
Jenkinsfile vendored
View File

@ -2,12 +2,11 @@
def branchName = "${env.BRANCH_NAME}"; 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.BRANCH_NAME = branchName;
env.TAG = "${env.BUILD_NUMBER}";
env.salixUser="${env.salixUser}"; env.salixUser="${env.salixUser}";
env.salixPassword="${env.salixPassword}"; env.salixPassword="${env.salixPassword}";
env.salixHost = "${env.productionSalixHost}";
env.salixPort = "${env.productionSalixPort}";
switch (branchName) { switch (branchName) {
case "test": case "test":
@ -17,7 +16,9 @@ switch (branchName) {
break; break;
case "master": case "master":
env.NODE_ENV = "production" 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; break;
} }
@ -28,26 +29,19 @@ node {
stage ('Checkout') { stage ('Checkout') {
checkout scm checkout scm
} }
stage ('Install client Node dependencies') {
stage ('install modules') {
sh "npm install" sh "npm install"
} }
stage ("Removing old dockers") {
stage ('build Project') { sh "docker-compose down --rmi 'all'"
}
stage ('Build project') {
sh "gulp build" sh "gulp build"
} }
stage ("Install services Node dependencies") {
stage ("docker") { sh "cd ./services/loopback && npm install"
stage ("install modules loopback service") { }
sh "cd ./services/loopback && npm install" stage ("Generating new dockers") {
} sh "docker-compose up -d --build"
stage ("Stopping/Removing Docker") {
sh "docker-compose down --rmi 'all'"
}
stage ("Generar dockers") {
sh "docker-compose up -d --build"
}
} }
} }