Merge branch 'dev' of https://git.verdnatura.es/salix into dev

This commit is contained in:
Javi Gallego 2018-04-30 08:33:36 +02:00
commit 118638a38b
14 changed files with 96 additions and 36 deletions

36
Jenkinsfile vendored
View File

@ -2,12 +2,11 @@
def branchName = "${env.BRANCH_NAME}";
// TODO: We are using latest tag until image rotation it's implemented
env.TAG = "latest" /* "${env.BUILD_NUMBER}" */;
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 "test":
@ -17,7 +16,9 @@ switch (branchName) {
break;
case "master":
env.NODE_ENV = "production"
env.DOCKER_HOST = "tcp://172.16.255.29:2375";
env.salixHost = "${env.productionSalixHost}";
env.salixPort = "${env.productionSalixPort}";
env.DOCKER_HOST = "tcp://vch1.verdnatura.es:2375";
break;
}
@ -28,26 +29,19 @@ node {
stage ('Checkout') {
checkout scm
}
stage ('install modules') {
stage ('Install client Node dependencies') {
sh "npm install"
}
stage ('build Project') {
stage ("Removing old dockers") {
sh "docker-compose down --rmi 'all'"
}
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"
}
stage ("Install services Node dependencies") {
sh "cd ./services/loopback && npm install"
}
stage ("Generating new dockers") {
sh "docker-compose up -d --build"
}
}

View File

@ -21,4 +21,3 @@ Credit contracts: Contratos de crédito
Verified data: Datos comprobados
Mandate: Mandato
Amount: Importe
Sales person: Comercial

View File

@ -6,7 +6,7 @@ mysqldump --defaults-file=connect.ini --no-create-info salix ACL >> install/dump
echo USE `vn`; >> install/dump/03-dumpedFixtures.sql
mysqldump --defaults-file=connect.ini --no-create-info vn cplusInvoiceType477 cplusSubjectOp cplusTaxBreak bookingPlanner pgc >> install/dump/03-dumpedFixtures.sql
echo USE `vn2008`; >> install/dump/03-dumpedFixtures.sql
mysqldump --defaults-file=connect.ini --no-create-info vn2008 accion_dits Gastos Tintas tarifa_componentes tarifa_componentes_series state bionic_updating_options >> install/dump/03-dumpedFixtures.sql
mysqldump --defaults-file=connect.ini --no-create-info vn2008 accion_dits Gastos Tintas tarifa_componentes tarifa_componentes_series state bionic_updating_options Grupos >> install/dump/03-dumpedFixtures.sql
echo USE `bi`; >> install/dump/03-dumpedFixtures.sql
mysqldump --defaults-file=connect.ini --no-create-info bi tarifa_componentes tarifa_componentes_series >> install/dump/03-dumpedFixtures.sql
echo USE `cache`; >> install/dump/03-dumpedFixtures.sql

View File

@ -7,7 +7,7 @@ mysqldump --defaults-file=connect.ini --no-create-info salix ACL >> install/dump
echo "USE \`vn\`;" >> install/dump/03-dumpedFixtures.sql
mysqldump --defaults-file=connect.ini --no-create-info vn cplusInvoiceType477 cplusSubjectOp cplusTaxBreak bookingPlanner pgc >> install/dump/03-dumpedFixtures.sql
echo "USE \`vn2008\`;" >> install/dump/03-dumpedFixtures.sql
mysqldump --defaults-file=connect.ini --no-create-info vn2008 accion_dits Gastos Tintas tarifa_componentes tarifa_componentes_series state bionic_updating_options >> install/dump/03-dumpedFixtures.sql
mysqldump --defaults-file=connect.ini --no-create-info vn2008 accion_dits Gastos Tintas tarifa_componentes tarifa_componentes_series state bionic_updating_options Grupos>> install/dump/03-dumpedFixtures.sql
echo "USE \`bi\`;" >> install/dump/03-dumpedFixtures.sql
mysqldump --defaults-file=connect.ini --no-create-info bi tarifa_componentes tarifa_componentes_series >> install/dump/03-dumpedFixtures.sql
echo "USE \`cache\`;" >> install/dump/03-dumpedFixtures.sql

View File

@ -0,0 +1,10 @@
USE `bs`;
CREATE
OR REPLACE ALGORITHM = UNDEFINED
DEFINER = `root`@`%`
SQL SECURITY DEFINER
VIEW `bs`.`workerMana` AS
SELECT
`m`.`Id_Trabajador` AS `workerFk`, `m`.`used` AS `amount`
FROM
`bs`.`mana_spellers` `m`;

File diff suppressed because one or more lines are too long

View File

@ -573,4 +573,12 @@ INSERT INTO `cache`.`cache_calc`(`id`, `cache_id`, `cacheName`, `params`, `last_
VALUES
( 1, 2, 'available', CONCAT_WS('/',1,CURDATE()), CURRENT_TIMESTAMP(), DATE_ADD(CURRENT_TIMESTAMP(),INTERVAL 15 MINUTE), CURDATE(), NULL),
( 2, 4, 'last_buy', CONCAT_WS('/',1,CURDATE()), CURRENT_TIMESTAMP(), DATE_ADD(CURRENT_TIMESTAMP(),INTERVAL 15 MINUTE), CURDATE(), NULL),
( 3, 8, 'visible', CONCAT_WS('/',1,CURDATE()), CURRENT_TIMESTAMP(), DATE_ADD(CURRENT_TIMESTAMP(),INTERVAL 15 MINUTE), CURDATE(), NULL);
( 3, 8, 'visible', CONCAT_WS('/',1,CURDATE()), CURRENT_TIMESTAMP(), DATE_ADD(CURRENT_TIMESTAMP(),INTERVAL 15 MINUTE), CURDATE(), NULL);
INSERT INTO `bs`.`workerMana`(`workerFk`, `amount`)
VALUES
( 1, -500),
( 3, 0),
( 5, 250),
( 6, 1000),
( 9, 1500);

View File

@ -4,6 +4,6 @@ describe('item filterItemTags()', () => {
it('should call the filterItemTags method', async() => {
let [result] = await app.models.ItemTag.filterItemTags(1);
expect(result.name).toEqual('Yellow');
expect(result.name).toEqual('Blue');
});
});

View File

@ -4,7 +4,7 @@ describe('ticket getTaxes()', () => {
it('should call the getTaxes method', done => {
app.models.Ticket.getTaxes(1)
.then(response => {
expect(response[0].tax).toEqual(1.05);
expect(response[0].tax).toEqual(6.05);
done();
});
});

View File

@ -4,7 +4,7 @@ describe('ticket getTotal()', () => {
it('should call the getTotal method and return the response', done => {
app.models.Ticket.getTotal(1)
.then(response => {
expect(response).toEqual(11.55);
expect(response).toEqual(248.05);
done();
});
});

View File

@ -78,7 +78,7 @@ module.exports = Self => {
where: {
ticketFk: ticketFk
},
order: 'concept ASC',
order: 'itemFk ASC',
include: [{
relation: 'item',
scope: {

View File

@ -0,0 +1,25 @@
{
"name": "WorkerMana",
"base": "VnModel",
"options": {
"mysql": {
"table": "workerMana"
}
},
"properties": {
"amount": {
"type": "String"
},
"workerFk": {
"id": true,
"type": "String"
}
},
"relations": {
"worker": {
"type": "belongsTo",
"model": "Worker",
"foreignKey": "workerFk"
}
}
}

View File

@ -45,5 +45,16 @@
"password": "${salixPassword}",
"connectTimeout": 20000,
"acquireTimeout": 20000
},
"bs": {
"connector": "mysql",
"database": "bs",
"debug": false,
"host": "${salixHost}",
"port": "${salixPort}",
"username": "${salixUser}",
"password": "${salixPassword}",
"connectTimeout": 20000,
"acquireTimeout": 20000
}
}

View File

@ -104,5 +104,8 @@
},
"Message": {
"dataSource": "vn"
},
"WorkerMana": {
"dataSource": "bs"
}
}