Jenkinsfile fixes, back scaled to 3 servers, nginx conf improved
This commit is contained in:
parent
3f08ab1b22
commit
8889f8d5cf
|
@ -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(
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -5,18 +5,21 @@ 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(/.*)?)$ {
|
upstream back {
|
||||||
resolver 127.0.0.11;
|
server back_1;
|
||||||
proxy_pass http://api:3000/$path$is_args$args;
|
server back_2;
|
||||||
|
server back_3;
|
||||||
}
|
}
|
||||||
location ~ ^(?:/(.*))?$ {
|
location ~ ^(/[a-zA-Z0-9_-]+)?/(?<path>api(/.*)?)$ {
|
||||||
alias /salix/dist/$1;
|
proxy_pass http://back:3000/$path$is_args$args;
|
||||||
|
}
|
||||||
|
location / {
|
||||||
autoindex on;
|
autoindex on;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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",
|
||||||
|
|
|
@ -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'
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
12
package.json
12
package.json
|
@ -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",
|
||||||
|
|
Loading…
Reference in New Issue