From 92a5679ff680f0c2e699eed3090655904fffcb80 Mon Sep 17 00:00:00 2001 From: Juan Date: Thu, 10 May 2018 17:50:42 +0200 Subject: [PATCH] Jenkinsfile --- Jenkinsfile | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index faa54427f..555508a31 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,30 +1,30 @@ #!/usr/bin/env groovy -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.TAG = 'latest' /* env.BUILD_NUMBER */; env.BRANCH_NAME = branchName; -env.salixUser="${env.salixUser}"; -env.salixPassword="${env.salixPassword}"; +env.salixUser = env.salixUser; +env.salixPassword = env.salixPassword; switch (branchName) { - case "test": - env.NODE_ENV = "test"; - env.salixHost = "${env.testSalixHost}"; - env.salixPort = "${env.testSalixPort}"; + case 'test': + env.NODE_ENV = 'test'; + env.salixHost = env.testSalixHost; + env.salixPort = env.testSalixPort; break; - case "master": - env.NODE_ENV = "production" - env.salixHost = "${env.productionSalixHost}"; - env.salixPort = "${env.productionSalixPort}"; - env.DOCKER_HOST = "tcp://vch1.verdnatura.es:2375"; + case 'master': + env.NODE_ENV = 'production' + env.salixHost = env.productionSalixHost; + env.salixPort = env.productionSalixPort; + env.DOCKER_HOST = 'tcp://vch1.verdnatura.es:2375'; break; } node { stage ('Print environment variables') { - echo "Branch ${branchName}, Build ${env.TAG}, salixHost ${env.salixHost}, NODE_ENV ${env.NODE_ENV} en docker Host ${env.DOCKER_HOST}" + echo "Branch ${branchName}, tag ${env.TAG}, environament ${env.NODE_ENV}" } stage ('Checkout') { checkout scm @@ -35,13 +35,13 @@ node { stage ('Build project') { sh "gulp build" } - stage ("Install services Node dependencies") { + stage ('Install services Node dependencies') { sh "cd ./services/loopback && npm install" } - stage ("Removing old dockers") { + stage ('Removing old dockers') { sh "docker-compose down --rmi 'all'" } - stage ("Generating new dockers") { + stage ('Generating new dockers') { sh "docker-compose up -d --build" } }