From 0ed7e5ee25b289ae719d46a660913be3a2caba76 Mon Sep 17 00:00:00 2001 From: Vicente Falco Date: Fri, 2 Mar 2018 13:08:48 +0100 Subject: [PATCH 1/7] Jenkins --- .env.json | 6 ++++ Jenkinsfile | 8 ++++- gulpfile.js | 25 +++++++++++----- package.json | 1 + services/db/03-changes.sh | 2 +- services/db/Dockerfile | 4 ++- services/loopback/server/datasources.json | 36 +++++++++++++---------- services/nginx/logs/error.log | 4 +++ 8 files changed, 60 insertions(+), 26 deletions(-) create mode 100644 .env.json create mode 100644 services/nginx/logs/error.log diff --git a/.env.json b/.env.json new file mode 100644 index 000000000..de4ba70f8 --- /dev/null +++ b/.env.json @@ -0,0 +1,6 @@ +{ + "salixHost": "localhost", + "salixPort": 3306, + "salixUser": "root", + "salixPassword": "" +} \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index d004f86bc..617a4f8f9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,10 +6,16 @@ def branchTest = "test"; env.BRANCH_NAME = branchName; env.TAG = "${env.BUILD_NUMBER}"; +env.salixUser="${env.salixUser}"; +env.salixPassword="${env.salixPassword}"; +env.salixHost = "${env.productionSalixHost}"; +env.salixPort = "${env.productionSalixPort}"; switch (branchName){ case branchTest: env.NODE_ENV = "test"; + env.salixHost = "${env.testSalixHost}"; + env.salixPort = "${env.testSalixPort}"; break; case branchProduction: env.DOCKER_HOST = "tcp://172.16.255.29:2375"; @@ -20,7 +26,7 @@ switch (branchName){ node { stage ('Print environment variables'){ - echo "Branch ${branchName}, Build ${env.TAG}, NODE_ENV ${env.NODE_ENV} en docker Host ${env.DOCKER_HOST}" + echo "Branch ${branchName}, Build ${env.TAG}, salixHost ${env.salixHost}, NODE_ENV ${env.NODE_ENV} en docker Host ${env.DOCKER_HOST}" } stage ('Checkout') { checkout scm diff --git a/gulpfile.js b/gulpfile.js index 303b15bc2..6fc495412 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,6 +1,7 @@ require('require-yaml'); const gulp = require('gulp'); const runSequence = require('run-sequence'); +const gulpEnv = require('gulp-env'); const fs = require('fs-extra'); const exec = require('child_process').exec; const PluginError = require('plugin-error'); @@ -27,6 +28,7 @@ let devServerPort = wpConfig.devServerPort; let nginxDir = `${servicesDir}/nginx`; let proxyConf = require(`${nginxDir}/config.yml`); let proxyEnvFile = `${nginxDir}/config.${env}.yml`; +let environmentFile = './.env.json'; if (fs.existsSync(proxyEnvFile)) Object.assign(proxyConf, require(proxyEnvFile)); @@ -37,18 +39,24 @@ let defaultPort = proxyConf.defaultPort; // Development gulp.task('default', () => { - return gulp.start('services', 'client'); + return gulp.start('environment', 'services', 'client'); }); gulp.task('client', ['build-clean'], async () => { await runSequenceP(['routes', 'locales'], 'watch', 'webpack-dev-server'); }); +gulp.task('environment', () => { + gulpEnv({ + file: environmentFile, + }); +}); + /** * Starts all backend services, including the nginx proxy and the database. */ gulp.task('services', async () => { - await runSequenceP('docker-start', 'services-only', 'nginx'); + await runSequenceP('environment', 'docker-start', 'services-only', 'nginx'); }); /** @@ -391,7 +399,7 @@ gulp.task('watch', function() { * Rebuilds the docker and it's image, if these already exist, destroys and * rebuilds them. */ -gulp.task('docker-rebuild', async () => { +gulp.task('docker-rebuild', ['environment'], async () => { try { await execP('docker rm -f dblocal'); } catch (e) {} @@ -434,10 +442,10 @@ gulp.task('docker-run', async () => { try { await execP('docker image inspect -f "{{json .Id}}" dblocal'); } catch (err) { - await execP('docker build -t dblocal:latest ./services/db'); + await execP(`docker build -t dblocal:latest --build-arg rootPassword=${process.env.salixPassword} ./services/db`); } - await execP('docker run -d --name dblocal -p 3306:3306 dblocal'); + await execP(`docker run -d --name dblocal -p ${process.env.salixPort}:${process.env.salixPort} dblocal`); await runSequenceP('docker-wait'); }); @@ -451,6 +459,7 @@ gulp.task('docker-wait', callback => { let elapsedTime = 0; let maxInterval = 30 * 60; + console.log('process', process.env.salixPassword); log('Waiting for MySQL init process...'); checker(); @@ -469,8 +478,10 @@ gulp.task('docker-wait', callback => { return callback(new Error('Docker exited, please see the docker logs for more info')); let conn = mysql.createConnection({ - host: 'localhost', - user: 'root' + host: process.env.salixHost, + port: process.env.salixPort, + user: process.env.salixUser, + password: process.env.salixPassword }); conn.on('error', () => {}); conn.connect(err => { diff --git a/package.json b/package.json index 059a1bedd..7b4c19023 100644 --- a/package.json +++ b/package.json @@ -44,6 +44,7 @@ "file-loader": "^1.1.6", "gulp": "^3.9.1", "gulp-concat": "^2.6.0", + "gulp-env": "^0.4.0", "gulp-extend": "^0.2.0", "gulp-install": "^1.1.0", "gulp-jasmine": "^3.0.0", diff --git a/services/db/03-changes.sh b/services/db/03-changes.sh index 4e0d23d3a..c372568b2 100644 --- a/services/db/03-changes.sh +++ b/services/db/03-changes.sh @@ -2,5 +2,5 @@ for file in changes/*/*.sql; do echo "Importing $file" - mysql -u root < $file + mysql -u root -p$salixPassword < $file done diff --git a/services/db/Dockerfile b/services/db/Dockerfile index 1cc2b17eb..a9845f2e1 100644 --- a/services/db/Dockerfile +++ b/services/db/Dockerfile @@ -1,6 +1,8 @@ FROM mysql:5.6.37 -ENV MYSQL_ALLOW_EMPTY_PASSWORD yes +ARG rootPassword +ENV salixPassword $rootPassword +ENV MYSQL_ROOT_PASSWORD $salixPassword ENV TZ GMT-1 WORKDIR /docker-entrypoint-initdb.d diff --git a/services/loopback/server/datasources.json b/services/loopback/server/datasources.json index da7bcd44a..945c81966 100644 --- a/services/loopback/server/datasources.json +++ b/services/loopback/server/datasources.json @@ -1,37 +1,41 @@ { "db": { + "name": "db", "connector": "memory" }, "vn": { + "name": "mysql", "connector": "mysql", "database": "vn", "debug": false, - "host": "localhost", - "port": 3306, - "username": "root", - "password": "", + "host": "${salixHost}", + "port": "${salixPort}", + "username": "${salixUser}", + "password": "${salixPassword}", "connectTimeout": 20000, "acquireTimeout": 20000 }, "salix": { + "name": "mysql", "connector": "mysql", "database": "salix", "debug": false, - "host": "localhost", - "port": 3306, - "username": "root", - "password": "", + "host": "${salixHost}", + "port": "${salixPort}", + "username": "${salixUser}", + "password": "${salixPassword}", "connectTimeout": 20000, "acquireTimeout": 20000 }, "account": { + "name": "mysql", "connector": "mysql", "database": "account", "debug": false, - "host": "localhost", - "port": 3306, - "username": "root", - "password": "", + "host": "${salixHost}", + "port": "${salixPort}", + "username": "${salixUser}", + "password": "${salixPassword}", "connectTimeout": 20000, "acquireTimeout": 20000 }, @@ -39,10 +43,10 @@ "connector": "mysql", "database": "edi", "debug": false, - "host": "localhost", - "port": 3306, - "username": "root", - "password": "", + "host": "${salixHost}", + "port": "${salixPort}", + "username": "${salixUser}", + "password": "${salixPassword}", "connectTimeout": 20000, "acquireTimeout": 20000 } diff --git a/services/nginx/logs/error.log b/services/nginx/logs/error.log new file mode 100644 index 000000000..a8a0e2953 --- /dev/null +++ b/services/nginx/logs/error.log @@ -0,0 +1,4 @@ +2018/03/02 09:31:59 [notice] 7044#10044: signal process started +2018/03/02 09:31:59 [notice] 3892#15188: signal process started +2018/03/02 09:39:40 [notice] 8636#14980: signal process started +2018/03/02 12:40:36 [notice] 8340#13172: signal process started From 2d05b61c8d596dc41998109b79f206e8539a71fb Mon Sep 17 00:00:00 2001 From: Vicente Falco Date: Fri, 2 Mar 2018 13:26:31 +0100 Subject: [PATCH 2/7] Jenkins --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 617a4f8f9..acdfeb4d7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,7 +26,7 @@ switch (branchName){ 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}, Build ${env.TAG}, salixHost ${env.salixHost}, NODE_ENV ${env.NODE_ENV} en docker Host ${env.DOCKER_HOST}" } stage ('Checkout') { checkout scm From 12d34668a93efa669b8218b074808cd95509a137 Mon Sep 17 00:00:00 2001 From: Vicente Falco Date: Fri, 2 Mar 2018 14:31:44 +0100 Subject: [PATCH 3/7] Jenkins --- gulpfile.js | 8 +++- services/loopback/server/.env.json | 6 +++ services/loopback/server/Jenkinsfile | 60 ++++++++++++++++++++++++++++ 3 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 services/loopback/server/.env.json create mode 100644 services/loopback/server/Jenkinsfile diff --git a/gulpfile.js b/gulpfile.js index 6fc495412..259ed3c29 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -152,7 +152,12 @@ gulp.task('docker-compose', async () => { // dockerFile = 'Dockerfile'; composeYml.services[service.name] = { - environment: ['NODE_ENV=${NODE_ENV}'], + environment: ['NODE_ENV=${NODE_ENV}', + 'salixHost=${salixHost}', + 'salixUser=${salixUser}', + 'salixPassword=${salixPassword}', + 'salixPort=${salixPort}' + ], container_name: `\${BRANCH_NAME}-${service.name}`, image: `${service.name}:\${TAG}`, build: { @@ -459,7 +464,6 @@ gulp.task('docker-wait', callback => { let elapsedTime = 0; let maxInterval = 30 * 60; - console.log('process', process.env.salixPassword); log('Waiting for MySQL init process...'); checker(); diff --git a/services/loopback/server/.env.json b/services/loopback/server/.env.json new file mode 100644 index 000000000..de4ba70f8 --- /dev/null +++ b/services/loopback/server/.env.json @@ -0,0 +1,6 @@ +{ + "salixHost": "localhost", + "salixPort": 3306, + "salixUser": "root", + "salixPassword": "" +} \ No newline at end of file diff --git a/services/loopback/server/Jenkinsfile b/services/loopback/server/Jenkinsfile new file mode 100644 index 000000000..617a4f8f9 --- /dev/null +++ b/services/loopback/server/Jenkinsfile @@ -0,0 +1,60 @@ +#!/usr/bin/env groovy + +def branchName = "${env.BRANCH_NAME}"; +def branchProduction = "master" +def branchTest = "test"; + +env.BRANCH_NAME = branchName; +env.TAG = "${env.BUILD_NUMBER}"; +env.salixUser="${env.salixUser}"; +env.salixPassword="${env.salixPassword}"; +env.salixHost = "${env.productionSalixHost}"; +env.salixPort = "${env.productionSalixPort}"; + +switch (branchName){ + case branchTest: + env.NODE_ENV = "test"; + env.salixHost = "${env.testSalixHost}"; + env.salixPort = "${env.testSalixPort}"; + break; + case branchProduction: + env.DOCKER_HOST = "tcp://172.16.255.29:2375"; + env.NODE_ENV = "production" + 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}" + } + stage ('Checkout') { + checkout scm + } + + stage ('install modules'){ + sh "npm install" + } + + stage ('build Project'){ + sh "gulp build" + } + + stage ("docker") + { + stage ("install modules loopback service") + { + sh "cd ./services/loopback && npm install" + } + + stage ("Stopping/Removing Docker") + { + sh "docker-compose down --rmi 'all'" + } + + stage ("Generar dockers") + { + sh "docker-compose up -d --build" + } + } +} From 2a5efb04ae09e59789545def3803af36496b4ff0 Mon Sep 17 00:00:00 2001 From: jgallego Date: Tue, 6 Mar 2018 12:44:10 +0100 Subject: [PATCH 4/7] angular inject minimify fixed factor VnPatch --- client/core/src/lib/crud.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/core/src/lib/crud.js b/client/core/src/lib/crud.js index 33c4c2091..c2f6f0de4 100644 --- a/client/core/src/lib/crud.js +++ b/client/core/src/lib/crud.js @@ -32,7 +32,7 @@ function put(mgPut) { } ngModule.factory('vnPut', put); -put.$inject = ['mgPatch']; +patch.$inject = ['mgPatch']; function patch(mgPatch) { return Object.assign({}, mgPatch, { success: 'vnSuccessFactoryCreate' From ffee716409c7784f4d40fa51c9ce235bb4a90a35 Mon Sep 17 00:00:00 2001 From: jgallego Date: Tue, 6 Mar 2018 13:01:05 +0100 Subject: [PATCH 5/7] Revert "Merge branch 'test' into dev" This reverts commit b6091775e5089dd3e2be75d9f262636c494fdb5e, reversing changes made to 42f1e1ec6f79358eda023957950fe3b2dc6a906b. --- .env.json | 6 --- Jenkinsfile | 8 +-- client/core/src/lib/crud.js | 2 +- gulpfile.js | 31 +++--------- package.json | 1 - services/db/03-changes.sh | 2 +- services/db/Dockerfile | 4 +- services/loopback/server/.env.json | 6 --- services/loopback/server/Jenkinsfile | 60 ----------------------- services/loopback/server/datasources.json | 36 ++++++-------- services/nginx/logs/error.log | 4 -- 11 files changed, 28 insertions(+), 132 deletions(-) delete mode 100644 .env.json delete mode 100644 services/loopback/server/.env.json delete mode 100644 services/loopback/server/Jenkinsfile delete mode 100644 services/nginx/logs/error.log diff --git a/.env.json b/.env.json deleted file mode 100644 index de4ba70f8..000000000 --- a/.env.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "salixHost": "localhost", - "salixPort": 3306, - "salixUser": "root", - "salixPassword": "" -} \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index acdfeb4d7..d004f86bc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,16 +6,10 @@ def branchTest = "test"; env.BRANCH_NAME = branchName; env.TAG = "${env.BUILD_NUMBER}"; -env.salixUser="${env.salixUser}"; -env.salixPassword="${env.salixPassword}"; -env.salixHost = "${env.productionSalixHost}"; -env.salixPort = "${env.productionSalixPort}"; switch (branchName){ case branchTest: env.NODE_ENV = "test"; - env.salixHost = "${env.testSalixHost}"; - env.salixPort = "${env.testSalixPort}"; break; case branchProduction: env.DOCKER_HOST = "tcp://172.16.255.29:2375"; @@ -26,7 +20,7 @@ switch (branchName){ 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}, Build ${env.TAG}, NODE_ENV ${env.NODE_ENV} en docker Host ${env.DOCKER_HOST}" } stage ('Checkout') { checkout scm diff --git a/client/core/src/lib/crud.js b/client/core/src/lib/crud.js index c2f6f0de4..33c4c2091 100644 --- a/client/core/src/lib/crud.js +++ b/client/core/src/lib/crud.js @@ -32,7 +32,7 @@ function put(mgPut) { } ngModule.factory('vnPut', put); -patch.$inject = ['mgPatch']; +put.$inject = ['mgPatch']; function patch(mgPatch) { return Object.assign({}, mgPatch, { success: 'vnSuccessFactoryCreate' diff --git a/gulpfile.js b/gulpfile.js index 259ed3c29..303b15bc2 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,7 +1,6 @@ require('require-yaml'); const gulp = require('gulp'); const runSequence = require('run-sequence'); -const gulpEnv = require('gulp-env'); const fs = require('fs-extra'); const exec = require('child_process').exec; const PluginError = require('plugin-error'); @@ -28,7 +27,6 @@ let devServerPort = wpConfig.devServerPort; let nginxDir = `${servicesDir}/nginx`; let proxyConf = require(`${nginxDir}/config.yml`); let proxyEnvFile = `${nginxDir}/config.${env}.yml`; -let environmentFile = './.env.json'; if (fs.existsSync(proxyEnvFile)) Object.assign(proxyConf, require(proxyEnvFile)); @@ -39,24 +37,18 @@ let defaultPort = proxyConf.defaultPort; // Development gulp.task('default', () => { - return gulp.start('environment', 'services', 'client'); + return gulp.start('services', 'client'); }); gulp.task('client', ['build-clean'], async () => { await runSequenceP(['routes', 'locales'], 'watch', 'webpack-dev-server'); }); -gulp.task('environment', () => { - gulpEnv({ - file: environmentFile, - }); -}); - /** * Starts all backend services, including the nginx proxy and the database. */ gulp.task('services', async () => { - await runSequenceP('environment', 'docker-start', 'services-only', 'nginx'); + await runSequenceP('docker-start', 'services-only', 'nginx'); }); /** @@ -152,12 +144,7 @@ gulp.task('docker-compose', async () => { // dockerFile = 'Dockerfile'; composeYml.services[service.name] = { - environment: ['NODE_ENV=${NODE_ENV}', - 'salixHost=${salixHost}', - 'salixUser=${salixUser}', - 'salixPassword=${salixPassword}', - 'salixPort=${salixPort}' - ], + environment: ['NODE_ENV=${NODE_ENV}'], container_name: `\${BRANCH_NAME}-${service.name}`, image: `${service.name}:\${TAG}`, build: { @@ -404,7 +391,7 @@ gulp.task('watch', function() { * Rebuilds the docker and it's image, if these already exist, destroys and * rebuilds them. */ -gulp.task('docker-rebuild', ['environment'], async () => { +gulp.task('docker-rebuild', async () => { try { await execP('docker rm -f dblocal'); } catch (e) {} @@ -447,10 +434,10 @@ gulp.task('docker-run', async () => { try { await execP('docker image inspect -f "{{json .Id}}" dblocal'); } catch (err) { - await execP(`docker build -t dblocal:latest --build-arg rootPassword=${process.env.salixPassword} ./services/db`); + await execP('docker build -t dblocal:latest ./services/db'); } - await execP(`docker run -d --name dblocal -p ${process.env.salixPort}:${process.env.salixPort} dblocal`); + await execP('docker run -d --name dblocal -p 3306:3306 dblocal'); await runSequenceP('docker-wait'); }); @@ -482,10 +469,8 @@ gulp.task('docker-wait', callback => { return callback(new Error('Docker exited, please see the docker logs for more info')); let conn = mysql.createConnection({ - host: process.env.salixHost, - port: process.env.salixPort, - user: process.env.salixUser, - password: process.env.salixPassword + host: 'localhost', + user: 'root' }); conn.on('error', () => {}); conn.connect(err => { diff --git a/package.json b/package.json index 7b4c19023..059a1bedd 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,6 @@ "file-loader": "^1.1.6", "gulp": "^3.9.1", "gulp-concat": "^2.6.0", - "gulp-env": "^0.4.0", "gulp-extend": "^0.2.0", "gulp-install": "^1.1.0", "gulp-jasmine": "^3.0.0", diff --git a/services/db/03-changes.sh b/services/db/03-changes.sh index c372568b2..4e0d23d3a 100644 --- a/services/db/03-changes.sh +++ b/services/db/03-changes.sh @@ -2,5 +2,5 @@ for file in changes/*/*.sql; do echo "Importing $file" - mysql -u root -p$salixPassword < $file + mysql -u root < $file done diff --git a/services/db/Dockerfile b/services/db/Dockerfile index a9845f2e1..1cc2b17eb 100644 --- a/services/db/Dockerfile +++ b/services/db/Dockerfile @@ -1,8 +1,6 @@ FROM mysql:5.6.37 -ARG rootPassword -ENV salixPassword $rootPassword -ENV MYSQL_ROOT_PASSWORD $salixPassword +ENV MYSQL_ALLOW_EMPTY_PASSWORD yes ENV TZ GMT-1 WORKDIR /docker-entrypoint-initdb.d diff --git a/services/loopback/server/.env.json b/services/loopback/server/.env.json deleted file mode 100644 index de4ba70f8..000000000 --- a/services/loopback/server/.env.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "salixHost": "localhost", - "salixPort": 3306, - "salixUser": "root", - "salixPassword": "" -} \ No newline at end of file diff --git a/services/loopback/server/Jenkinsfile b/services/loopback/server/Jenkinsfile deleted file mode 100644 index 617a4f8f9..000000000 --- a/services/loopback/server/Jenkinsfile +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env groovy - -def branchName = "${env.BRANCH_NAME}"; -def branchProduction = "master" -def branchTest = "test"; - -env.BRANCH_NAME = branchName; -env.TAG = "${env.BUILD_NUMBER}"; -env.salixUser="${env.salixUser}"; -env.salixPassword="${env.salixPassword}"; -env.salixHost = "${env.productionSalixHost}"; -env.salixPort = "${env.productionSalixPort}"; - -switch (branchName){ - case branchTest: - env.NODE_ENV = "test"; - env.salixHost = "${env.testSalixHost}"; - env.salixPort = "${env.testSalixPort}"; - break; - case branchProduction: - env.DOCKER_HOST = "tcp://172.16.255.29:2375"; - env.NODE_ENV = "production" - 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}" - } - stage ('Checkout') { - checkout scm - } - - stage ('install modules'){ - sh "npm install" - } - - stage ('build Project'){ - sh "gulp build" - } - - stage ("docker") - { - stage ("install modules loopback service") - { - sh "cd ./services/loopback && npm install" - } - - stage ("Stopping/Removing Docker") - { - sh "docker-compose down --rmi 'all'" - } - - stage ("Generar dockers") - { - sh "docker-compose up -d --build" - } - } -} diff --git a/services/loopback/server/datasources.json b/services/loopback/server/datasources.json index 945c81966..da7bcd44a 100644 --- a/services/loopback/server/datasources.json +++ b/services/loopback/server/datasources.json @@ -1,41 +1,37 @@ { "db": { - "name": "db", "connector": "memory" }, "vn": { - "name": "mysql", "connector": "mysql", "database": "vn", "debug": false, - "host": "${salixHost}", - "port": "${salixPort}", - "username": "${salixUser}", - "password": "${salixPassword}", + "host": "localhost", + "port": 3306, + "username": "root", + "password": "", "connectTimeout": 20000, "acquireTimeout": 20000 }, "salix": { - "name": "mysql", "connector": "mysql", "database": "salix", "debug": false, - "host": "${salixHost}", - "port": "${salixPort}", - "username": "${salixUser}", - "password": "${salixPassword}", + "host": "localhost", + "port": 3306, + "username": "root", + "password": "", "connectTimeout": 20000, "acquireTimeout": 20000 }, "account": { - "name": "mysql", "connector": "mysql", "database": "account", "debug": false, - "host": "${salixHost}", - "port": "${salixPort}", - "username": "${salixUser}", - "password": "${salixPassword}", + "host": "localhost", + "port": 3306, + "username": "root", + "password": "", "connectTimeout": 20000, "acquireTimeout": 20000 }, @@ -43,10 +39,10 @@ "connector": "mysql", "database": "edi", "debug": false, - "host": "${salixHost}", - "port": "${salixPort}", - "username": "${salixUser}", - "password": "${salixPassword}", + "host": "localhost", + "port": 3306, + "username": "root", + "password": "", "connectTimeout": 20000, "acquireTimeout": 20000 } diff --git a/services/nginx/logs/error.log b/services/nginx/logs/error.log deleted file mode 100644 index a8a0e2953..000000000 --- a/services/nginx/logs/error.log +++ /dev/null @@ -1,4 +0,0 @@ -2018/03/02 09:31:59 [notice] 7044#10044: signal process started -2018/03/02 09:31:59 [notice] 3892#15188: signal process started -2018/03/02 09:39:40 [notice] 8636#14980: signal process started -2018/03/02 12:40:36 [notice] 8340#13172: signal process started From 4c7ba9859cb15b3b207870f114316869e8daf022 Mon Sep 17 00:00:00 2001 From: jgallego Date: Tue, 6 Mar 2018 13:08:39 +0100 Subject: [PATCH 6/7] anguar inject minimify fixed factor VnPatch --- client/core/src/lib/crud.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/core/src/lib/crud.js b/client/core/src/lib/crud.js index 33c4c2091..c2f6f0de4 100644 --- a/client/core/src/lib/crud.js +++ b/client/core/src/lib/crud.js @@ -32,7 +32,7 @@ function put(mgPut) { } ngModule.factory('vnPut', put); -put.$inject = ['mgPatch']; +patch.$inject = ['mgPatch']; function patch(mgPatch) { return Object.assign({}, mgPatch, { success: 'vnSuccessFactoryCreate' From b2601571713258ec2b85eb30efa8c5feb4d268c5 Mon Sep 17 00:00:00 2001 From: jgallego Date: Fri, 9 Mar 2018 14:54:25 +0100 Subject: [PATCH 7/7] =?UTF-8?q?recobro=20a=C3=B1adir=20candado=20#158=20fa?= =?UTF-8?q?ltan=20los=20test=20de=20front?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/client/src/recovery-list/locale/es.yml | 3 ++- .../src/recovery-list/recovery-list.html | 12 +++++++++--- .../client/src/recovery-list/recovery-list.js | 19 ++++++++++++++++++- 3 files changed, 29 insertions(+), 5 deletions(-) diff --git a/client/client/src/recovery-list/locale/es.yml b/client/client/src/recovery-list/locale/es.yml index a3413cb66..3ad385a5c 100644 --- a/client/client/src/recovery-list/locale/es.yml +++ b/client/client/src/recovery-list/locale/es.yml @@ -2,4 +2,5 @@ Since: Desde Employee: Empleado No results: Sin resultados To: Hasta -Recovery: Recobros \ No newline at end of file +Recovery: Recobros +Finish that recovery period: Terminar el recobro \ No newline at end of file diff --git a/client/client/src/recovery-list/recovery-list.html b/client/client/src/recovery-list/recovery-list.html index 77a31d5d3..4c2eff922 100644 --- a/client/client/src/recovery-list/recovery-list.html +++ b/client/client/src/recovery-list/recovery-list.html @@ -4,7 +4,7 @@ Recovery - + @@ -13,9 +13,15 @@ + ng-repeat="recovery in index.model.instances track by $index"> + + lock + {{::recovery.started | date:'dd/MM/yyyy' }} - {{::recovery.finished | date:'dd/MM/yyyy' }} + {{recovery.finished | date:'dd/MM/yyyy' }} {{::recovery.amount | currency:'€':0}} {{::recovery.period}} diff --git a/client/client/src/recovery-list/recovery-list.js b/client/client/src/recovery-list/recovery-list.js index 949dcbad1..5996f2d50 100644 --- a/client/client/src/recovery-list/recovery-list.js +++ b/client/client/src/recovery-list/recovery-list.js @@ -1,7 +1,24 @@ import ngModule from '../module'; import FilterClientList from '../filter-client-list'; +class ClientRecoveryList extends FilterClientList { + constructor($scope, $timeout, $state, $http) { + super($scope, $timeout, $state); + this.$http = $http; + } + setFinished(recovery) { + if (!recovery.finished) { + let params = {finished: Date.now()}; + this.$http.patch(`/client/api/Recoveries/${recovery.id}`, params).then( + () => this.$.index.accept() + ); + } + } +} + +ClientRecoveryList.$inject = ['$scope', '$timeout', '$state', '$http']; + ngModule.component('vnClientRecoveryList', { template: require('./recovery-list.html'), - controller: FilterClientList + controller: ClientRecoveryList });