This commit is contained in:
Juan 2018-04-06 18:14:49 +02:00
parent 65e7b97ec0
commit 5fc446c05f
1 changed files with 12 additions and 19 deletions

23
Jenkinsfile vendored
View File

@ -1,8 +1,6 @@
#!/usr/bin/env groovy
def branchName = "${env.BRANCH_NAME}";
def branchProduction = "master"
def branchTest = "test";
env.BRANCH_NAME = branchName;
env.TAG = "${env.BUILD_NUMBER}";
@ -12,19 +10,18 @@ env.salixHost = "${env.productionSalixHost}";
env.salixPort = "${env.productionSalixPort}";
switch (branchName) {
case branchTest:
case "test":
env.NODE_ENV = "test";
env.salixHost = "${env.testSalixHost}";
env.salixPort = "${env.testSalixPort}";
break;
case branchProduction:
env.DOCKER_HOST = "tcp://172.16.255.29:2375";
case "master":
env.NODE_ENV = "production"
env.DOCKER_HOST = "tcp://172.16.255.29:2375";
break;
}
node
{
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}"
}
@ -40,20 +37,16 @@ node
sh "gulp build"
}
stage ("docker")
{
stage ("install modules loopback service")
{
stage ("docker") {
stage ("install modules loopback service") {
sh "cd ./services/loopback && npm install"
}
stage ("Stopping/Removing Docker")
{
stage ("Stopping/Removing Docker") {
sh "docker-compose down --rmi 'all'"
}
stage ("Generar dockers")
{
stage ("Generar dockers") {
sh "docker-compose up -d --build"
}
}