swag-payments/gulpfile.js
Andrew Mayorov 27a8069f28 ITS-21: Prepare for the release (#31)
* ITS-21: Make the spec ready for ReDoc

* ITS-21: Make it possible to define paths in subdirs

* ITS-21: Translate tags back to English + abuse x-displayName

* ITS-21: Introduce Makefile

* ITS-21: Describe analytics operations more

* ITS-21: Describe analytics definitions more

* ITS-21: Fix tag descriptions a bit

* ITS-21: Describe geo operations

* ITS-21: Translate common parameter descriptions

* ITS-21: Describe invoice/payments operations and definitions

* ITS-21 Make shop/party activation/suspension truly idempotent. Fix UpdateShopArgs definition

* ITS-21: Describe payments/tokens operations and definitions

* ITS-21: Describe invoice.reason property

* ITS-21: Describe user interactions

* ITS-21: Unskuccaite all the paths backs

* ITS-21: Fix warnings + use hack w/ allOf where applicable

* ITS-21 Rename all Args to Params

* ITS-21 Rename context to metadata
2017-02-06 15:09:03 +03:00

51 lines
1.3 KiB
JavaScript

var gulp = require('gulp');
var util = require('gulp-util')
var gulpConnect = require('gulp-connect');
var connect = require('connect');
var cors = require('cors');
var path = require('path');
var exec = require('child_process').exec;
var portfinder = require('portfinder');
var swaggerRepo = require('swagger-repo');
var DIST_DIR = 'web_deploy';
gulp.task('serve', ['build', 'watch', 'edit'], function() {
portfinder.getPort({port: 3000}, function (err, port) {
gulpConnect.server({
root: [DIST_DIR],
livereload: true,
port: port,
middleware: function (gulpConnect, opt) {
return [
cors()
]
}
});
});
});
gulp.task('edit', function() {
portfinder.getPort({port: 5000}, function (err, port) {
var app = connect();
app.use(swaggerRepo.swaggerEditorMiddleware());
app.listen(port);
util.log(util.colors.green('swagger-editor started http://localhost:' + port));
});
});
gulp.task('build', function (cb) {
exec('npm run build', function (err, stdout, stderr) {
console.log(stderr);
cb(err);
});
});
gulp.task('reload', ['build'], function () {
gulp.src(DIST_DIR).pipe(gulpConnect.reload())
});
gulp.task('watch', function () {
gulp.watch(['spec/**/*', 'web/**/*'], ['reload']);
});