docker DB local
This commit is contained in:
parent
09a24fe8e8
commit
d07f65893d
19
gulpfile.js
19
gulpfile.js
|
@ -6,6 +6,7 @@ var merge = require('merge-stream');
|
||||||
var extend = require('gulp-extend');
|
var extend = require('gulp-extend');
|
||||||
var install = require('gulp-install');
|
var install = require('gulp-install');
|
||||||
var print = require('gulp-print');
|
var print = require('gulp-print');
|
||||||
|
var runSequence = require('run-sequence');
|
||||||
var del = require('del');
|
var del = require('del');
|
||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var webpack = require('webpack');
|
var webpack = require('webpack');
|
||||||
|
@ -151,23 +152,25 @@ gulp.task('watch', function() {
|
||||||
gulp.watch(localeFiles, ['locales']);
|
gulp.watch(localeFiles, ['locales']);
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('test', ['deleteDockerDb', 'buildDockerDb'], (callback) => {
|
gulp.task('test', () => {
|
||||||
exec('docker run -d --name dbLocal -p 3306:3306 dblocal:latest', (err, stdout, stderr) => {
|
process.env.NODE_ENV = gutil.env.env || 'test';
|
||||||
if (err) {
|
console.log(process.env.NODE_ENV);
|
||||||
throw new Error(err);
|
runSequence('deleteDockerDb', 'buildDockerDb', 'runDockerDb');
|
||||||
}
|
});
|
||||||
|
|
||||||
|
gulp.task('runDockerDb', (callback) => {
|
||||||
|
exec('docker run -d --name dblocal -p 3306:3306 dblocal:latest', (err, stdout, stderr) => {
|
||||||
callback(err);
|
callback(err);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('buildDockerDb', (callback) => {
|
gulp.task('buildDockerDb', (callback) => {
|
||||||
exec('docker build -t dblocal:latest ./services/db', (err, stdout, stderr) => {
|
exec('docker build -t dblocal:latest ./services/db', (err, stdout, stderr) => {
|
||||||
if (err)
|
|
||||||
throw new Error(err);
|
|
||||||
callback(err);
|
callback(err);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
gulp.task('deleteDockerDb', (callback) => {
|
gulp.task('deleteDockerDb', (callback) => {
|
||||||
exec('docker rm -f dbLocal', () => {
|
exec('docker rm -f dblocal', (err, stdout, stderr) => {
|
||||||
callback();
|
callback();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -60,6 +60,7 @@
|
||||||
"node-sass": "^3.11.0",
|
"node-sass": "^3.11.0",
|
||||||
"nodemon": "^1.12.0",
|
"nodemon": "^1.12.0",
|
||||||
"raw-loader": "*",
|
"raw-loader": "*",
|
||||||
|
"run-sequence": "^2.2.0",
|
||||||
"sass-loader": "^4.0.2",
|
"sass-loader": "^4.0.2",
|
||||||
"style-loader": "^0.13.1",
|
"style-loader": "^0.13.1",
|
||||||
"webpack": "^2.2.0",
|
"webpack": "^2.2.0",
|
||||||
|
|
Loading…
Reference in New Issue