Development environment now points to local database by default
This commit is contained in:
parent
9090c56c64
commit
87b3ac995d
|
@ -3,5 +3,7 @@ node_modules
|
|||
build
|
||||
npm-debug.log
|
||||
debug.log
|
||||
datasources.test.json
|
||||
datasources.development.json
|
||||
.idea
|
||||
.idea
|
||||
|
|
41
gulpfile.js
41
gulpfile.js
|
@ -29,18 +29,26 @@ gulp.task('default', () => {
|
|||
return gulp.start('services', 'client');
|
||||
});
|
||||
|
||||
gulp.task('build', ['clean'], () => {
|
||||
return gulp.start('routes', 'locales', 'webpack');
|
||||
});
|
||||
|
||||
gulp.task('client', ['clean'], () => {
|
||||
return gulp.start('watch', 'routes', 'locales', 'webpack-dev-server');
|
||||
});
|
||||
|
||||
gulp.task('services', ['nginx'], () => {
|
||||
if (gutil.env.env && !process.env.NODE_ENV)
|
||||
process.env.NODE_ENV = gutil.env.env;
|
||||
gulp.task('services', callback => {
|
||||
let isWindows = /^win/.test(process.platform);
|
||||
let command = isWindows ? 'docker inspect dblocal | findstr Status' : 'docker inspect dblocal | grep Status';
|
||||
|
||||
exec(command, (err, stdout, stderr) => {
|
||||
let isNotRunning = !stdout.includes('running');
|
||||
if (isNotRunning) {
|
||||
runSequence('docker', 'waitForMySQL', 'run-services');
|
||||
} else {
|
||||
runSequence('run-services');
|
||||
}
|
||||
callback(err);
|
||||
});
|
||||
});
|
||||
|
||||
gulp.task('run-services', ['nginx'], () => {
|
||||
const servicesPath = './services/';
|
||||
const services = fs.readdirSync(servicesPath);
|
||||
services.splice(services.indexOf('loopback'), 1);
|
||||
|
@ -72,19 +80,8 @@ gulp.task('install', () => {
|
|||
}));
|
||||
});
|
||||
|
||||
gulp.task('servicesDev', callback => {
|
||||
let isWindows = /^win/.test(process.platform);
|
||||
let command = isWindows ? 'docker inspect dblocal | findstr Status' : 'docker inspect dblocal | grep Status';
|
||||
gutil.env.env = 'test';
|
||||
exec(command, (err, stdout, stderr) => {
|
||||
let isNotRunning = !stdout.includes('running');
|
||||
if (isNotRunning) {
|
||||
runSequence('docker', 'waitForMySQL', 'services');
|
||||
} else {
|
||||
runSequence('services');
|
||||
}
|
||||
callback(err);
|
||||
});
|
||||
gulp.task('build', ['clean'], () => {
|
||||
return gulp.start('routes', 'locales', 'webpack');
|
||||
});
|
||||
|
||||
// Nginx
|
||||
|
@ -186,7 +183,7 @@ gulp.task('test', callback => {
|
|||
// E2E tests
|
||||
|
||||
gulp.task('e2e', callback => {
|
||||
runSequence('docker', 'waitForMySQL', 'endToEndTests', callback);
|
||||
runSequence('docker', 'waitForMySQL', 'run-e2e', callback);
|
||||
});
|
||||
|
||||
gulp.task('waitForMySQL', callback => {
|
||||
|
@ -210,7 +207,7 @@ gulp.task('waitForMySQL', callback => {
|
|||
}, interval);
|
||||
});
|
||||
|
||||
gulp.task('endToEndTests', callback => {
|
||||
gulp.task('run-e2e', callback => {
|
||||
gulp.src('./e2e_tests.js')
|
||||
.pipe(jasmine({reporter: 'none'}));
|
||||
});
|
||||
|
|
|
@ -1,5 +1 @@
|
|||
node_modules
|
||||
config.json
|
||||
app.development.json
|
||||
smtp.development.json
|
||||
mysql.development.json
|
||||
|
|
|
@ -1,5 +1 @@
|
|||
node_modules
|
||||
config.json
|
||||
app.development.json
|
||||
smtp.development.json
|
||||
mysql.development.json
|
||||
|
|
Loading…
Reference in New Issue