This commit is contained in:
Carlos Jimenez Ruiz 2019-02-01 12:38:14 +01:00
commit 812833dbf6
6 changed files with 29 additions and 23 deletions

8
Jenkinsfile vendored
View File

@ -101,7 +101,7 @@ pipeline {
steps { steps {
withCredentials([dockerCert(credentialsId: 'docker', variable: 'DOCKER_CERT_PATH')]) { withCredentials([dockerCert(credentialsId: 'docker', variable: 'DOCKER_CERT_PATH')]) {
sh 'docker-compose pull' sh 'docker-compose pull'
sh 'docker-compose up -d' sh 'docker-compose up -d --scale back=3'
} }
} }
} }
@ -112,7 +112,7 @@ pipeline {
steps { steps {
withCredentials([dockerCert(credentialsId: 'docker', variable: 'DOCKER_CERT_PATH')]) { withCredentials([dockerCert(credentialsId: 'docker', variable: 'DOCKER_CERT_PATH')]) {
sh 'docker-compose pull' sh 'docker-compose pull'
sh 'docker-compose up -d' sh 'docker-compose up -d --scale back=3'
} }
} }
} }
@ -129,8 +129,10 @@ pipeline {
} }
post { post {
always { always {
// junit '*/junit.xml'
script { script {
if (env.BRANCH_NAME == 'dev')
junit '*/junitresults.xml'
if (!env.GIT_COMMITTER_EMAIL) return if (!env.GIT_COMMITTER_EMAIL) return
try { try {
mail( mail(

View File

@ -1,7 +1,7 @@
version: '3.5' version: '3.5'
services: services:
app: front:
image: registry.verdnatura.es/salix-app:${TAG} image: registry.verdnatura.es/salix-front:${TAG}
restart: unless-stopped restart: unless-stopped
build: build:
context: . context: .
@ -9,9 +9,9 @@ services:
ports: ports:
- ${PORT}:80 - ${PORT}:80
links: links:
- api - back
api: back:
image: registry.verdnatura.es/salix-api:${TAG} image: registry.verdnatura.es/salix-back:${TAG}
restart: unless-stopped restart: unless-stopped
build: . build: .
environment: environment:

View File

@ -1,22 +1,25 @@
upstream back {
server back_1:3000;
server back_2:3000;
server back_3:3000;
}
server { server {
listen 80 default_server; listen 80 default_server;
listen [::]:80 default_server; listen [::]:80 default_server;
server_name _; server_name _;
autoindex off; autoindex off;
root /usr/share/nginx/html; root /salix/dist;
error_page 404 = @notfound; error_page 404 = @notfound;
location @notfound { location @notfound {
return 302 /; return 302 /;
} }
location ~ ^(/[a-zA-Z0-9_-]+)?/(?<path>api(/.*)?)$ { location ~ ^(/[a-zA-Z0-9_-]+)?/(?<path>api(/.*)?)$ {
resolver 127.0.0.11; proxy_pass http://back/$path$is_args$args;
proxy_pass http://api:3000/$path$is_args$args;
} }
location ~ ^(?:/(.*))?$ { location / {
alias /salix/dist/$1;
autoindex on; autoindex on;
} }
} }

View File

@ -1,11 +1,12 @@
{ {
"name": "salix-client", "name": "salix-front",
"version": "1.0.0", "version": "1.0.0",
"description": "Salix client", "author": "Verdnatura Levante SL",
"description": "Salix frontend",
"license": "GPL-3.0", "license": "GPL-3.0",
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://git.verdnatura.es/salix" "url": "https://gitea.verdnatura.es/verdnatura/salix"
}, },
"dependencies": { "dependencies": {
"@babel/polyfill": "^7.2.5", "@babel/polyfill": "^7.2.5",

View File

@ -119,7 +119,7 @@ module.exports = function(config) {
singleRun: true, singleRun: true,
reporters: ['dots', 'junit'], reporters: ['dots', 'junit'],
junitReporter: { junitReporter: {
outputFile: 'junit.xml' outputFile: 'junitresults.xml'
} }
}); });
} }

View File

@ -1,9 +1,13 @@
{ {
"name": "salix-app", "name": "salix-back",
"version": "1.0.0", "version": "1.0.0",
"author": "Verdnatura Levante SL", "author": "Verdnatura Levante SL",
"description": "Salix application", "description": "Salix backend",
"license": "GPL-3.0", "license": "GPL-3.0",
"repository": {
"type": "git",
"url": "https://gitea.verdnatura.es/verdnatura/salix"
},
"dependencies": { "dependencies": {
"compression": "^1.7.3", "compression": "^1.7.3",
"fs-extra": "^5.0.0", "fs-extra": "^5.0.0",
@ -78,10 +82,6 @@
"webpack-merge": "^4.2.1", "webpack-merge": "^4.2.1",
"yaml-loader": "^0.5.0" "yaml-loader": "^0.5.0"
}, },
"repository": {
"type": "git",
"url": "https://git.verdnatura.es/salix"
},
"scripts": { "scripts": {
"test": "nodemon -q back/tests.js -w modules", "test": "nodemon -q back/tests.js -w modules",
"dbtest": "nodemon -q services/db/tests.js -w services/db/tests", "dbtest": "nodemon -q services/db/tests.js -w services/db/tests",