diff --git a/Jenkinsfile b/Jenkinsfile index 16a1d0eef..d8d587d9f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ switch (env.BRANCH_NAME) { case 'test': - env.NODE_ENV = 'test'; + env.NODE_ENV = 'test' break; case 'master': env.NODE_ENV = 'production' @@ -30,7 +30,6 @@ node { } stage ('Docker deployment') { withCredentials([dockerCert(credentialsId: 'docker', variable: 'DOCKER_CERT_PATH')]) { - env.COMPOSE_HTTP_TIMEOUT = 300 env.COMPOSE_PROJECT_NAME = 'salix' env.DOCKER_TLS_VERIFY = 1 @@ -38,6 +37,18 @@ node { env.COMPOSE_PROJECT_NAME = "${env.BRANCH_NAME}-salix" } + switch (env.BRANCH_NAME) { + case 'master': + env.PORT = 5000 + break; + case 'test': + env.PORT = 5001 + break; + } + + env.DOCKER_HOST = 'tcp://vch1.verdnatura.es:2376'; + sh "docker-compose up --build -d" + env.DOCKER_HOST = 'tcp://vch2.verdnatura.es:2376'; sh "docker-compose up --build -d" } diff --git a/docker-compose.yml b/docker-compose.yml index 5a2c4e94d..32672f080 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: context: . dockerfile: services/nginx/Dockerfile ports: - - 80:80 + - ${PORT}:80 image: salix-app:latest restart: unless-stopped links: @@ -13,7 +13,7 @@ services: api: build: . environment: - NODE_ENV: test + NODE_ENV: ${NODE_ENV} restart: unless-stopped image: salix-api:latest volumes: