datasource loopback unique
This commit is contained in:
parent
aad1d5d0f3
commit
95e96a91a7
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"salixHost": "localhost",
|
||||
"salixPort": "3306",
|
||||
"salixUser": "root",
|
||||
"salixPassword": "root"
|
||||
}
|
|
@ -6,10 +6,14 @@ def branchTest = "test";
|
|||
|
||||
env.BRANCH_NAME = branchName;
|
||||
env.TAG = "${env.BUILD_NUMBER}";
|
||||
env.salixUser="${env.salixUser}";
|
||||
env.salixPassword="${env.salixPassword}";
|
||||
|
||||
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 +24,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
|
||||
|
|
20
gulpfile.js
20
gulpfile.js
|
@ -6,6 +6,7 @@ const exec = require('child_process').exec;
|
|||
const PluginError = require('plugin-error');
|
||||
const argv = require('minimist')(process.argv.slice(2));
|
||||
const log = require('fancy-log');
|
||||
const environment = require('gulp-env');
|
||||
|
||||
// Configuration
|
||||
|
||||
|
@ -37,7 +38,13 @@ let defaultPort = proxyConf.defaultPort;
|
|||
// Development
|
||||
|
||||
gulp.task('default', () => {
|
||||
return gulp.start('services', 'client');
|
||||
return gulp.start('environment', 'services', 'client');
|
||||
});
|
||||
|
||||
gulp.task('environment', async () => {
|
||||
await environment({
|
||||
file: '.env.json'
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('client', ['build-clean'], async () => {
|
||||
|
@ -48,7 +55,7 @@ gulp.task('client', ['build-clean'], async () => {
|
|||
* 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');
|
||||
});
|
||||
|
||||
/**
|
||||
|
@ -137,7 +144,7 @@ gulp.task('install', () => {
|
|||
// Deployment
|
||||
|
||||
gulp.task('build', ['clean'], async () => {
|
||||
await runSequenceP(['routes', 'locales', 'webpack', 'docker-compose', 'nginx-conf']);
|
||||
await runSequenceP(['environment', 'routes', 'locales', 'webpack', 'docker-compose', 'nginx-conf']);
|
||||
});
|
||||
|
||||
gulp.task('docker-compose', async () => {
|
||||
|
@ -154,7 +161,9 @@ gulp.task('docker-compose', async () => {
|
|||
// dockerFile = 'Dockerfile';
|
||||
|
||||
composeYml.services[service.name] = {
|
||||
environment: ['NODE_ENV=${NODE_ENV}'],
|
||||
environment: ['NODE_ENV=${NODE_ENV}' ,'salixHost=${salixHost}', 'salixPort=${salixPort}',
|
||||
'salixUser=${salixUser}', 'salixPassword=${salixPassword}'
|
||||
],
|
||||
container_name: `\${BRANCH_NAME}-${service.name}`,
|
||||
image: `${service.name}:\${TAG}`,
|
||||
build: {
|
||||
|
@ -480,7 +489,8 @@ gulp.task('docker-wait', callback => {
|
|||
|
||||
let conn = mysql.createConnection({
|
||||
host: 'localhost',
|
||||
user: 'root'
|
||||
user: 'root',
|
||||
password: 'root'
|
||||
});
|
||||
conn.on('error', () => {});
|
||||
conn.connect(err => {
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
// const SpecReporter = require('jasmine-spec-reporter').SpecReporter;
|
||||
|
||||
// module.exports = {
|
||||
// reporter: new SpecReporter({
|
||||
// spec: {
|
||||
// // displayStacktrace: 'summary',
|
||||
// displaySuccessful: false,
|
||||
// displayFailedSpec: true,
|
||||
// displaySpecDuration: true
|
||||
// }
|
||||
// }),
|
||||
// config: {
|
||||
// spec_dir: 'services',
|
||||
// spec_files: [
|
||||
// // '**/*.spec.js',
|
||||
// 'auth/server/**/*.spec.js',
|
||||
// 'client/common/**/*.spec.js',
|
||||
// 'loopback/common/**/*.spec.js'
|
||||
// ],
|
||||
// helpers: [
|
||||
// '/services/utils/jasmineHelpers.js'
|
||||
// ]
|
||||
// }
|
||||
// };
|
|
@ -2,5 +2,5 @@
|
|||
|
||||
for file in changes/*/*.sql; do
|
||||
echo "Importing $file"
|
||||
mysql -u root < $file
|
||||
mysql -u root -proot < $file
|
||||
done
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
FROM mysql:5.6.37
|
||||
|
||||
ENV MYSQL_ALLOW_EMPTY_PASSWORD yes
|
||||
ENV MYSQL_ROOT_PASSWORD root
|
||||
ENV TZ GMT-1
|
||||
|
||||
WORKDIR /docker-entrypoint-initdb.d
|
||||
|
|
|
@ -4,7 +4,7 @@ let connection = mysql.createConnection({
|
|||
multipleStatements: true,
|
||||
host: 'localhost',
|
||||
user: 'root',
|
||||
password: '',
|
||||
password: 'root',
|
||||
database: 'salix'
|
||||
});
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
"port": 3306,
|
||||
"database": "vn",
|
||||
"user": "root",
|
||||
"password": ""
|
||||
"password": "root"
|
||||
},
|
||||
"smtp": {
|
||||
"host": "localhost",
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
"port": 3306,
|
||||
"database": "vn",
|
||||
"user": "root",
|
||||
"password": ""
|
||||
"password": "root"
|
||||
},
|
||||
"pdf": {
|
||||
"format": "A4",
|
||||
|
|
|
@ -13,6 +13,9 @@ if (process.argv[2] === '--v') {
|
|||
var Jasmine = require('jasmine');
|
||||
var jasmine = new Jasmine();
|
||||
var SpecReporter = require('jasmine-spec-reporter').SpecReporter;
|
||||
let environment = require('gulp-env');
|
||||
|
||||
environment(".env.json");
|
||||
|
||||
jasmine.loadConfig({
|
||||
spec_dir: 'services',
|
||||
|
|
Loading…
Reference in New Issue