![Ian Wienand](/assets/img/avatar_default.png)
It seems that on a CI node, we just want to have approximately "pip install stackviz" and have it "just work". This makes "npm run prod" produce a .tar.gz appropriate for this. Firstly, I have moved the gulp output to "gulp-build" rather than "build" because "build" is generic and can get distutils confused. Second, after building with gulp, we tack on a "setup.py sdist" call to generate the final package. Thirdly, the MANIFEST.in is updated to prune out unneeded files from the final distribution. pbr is putting everything in git into the manifest, but we can trim all all the nodejs source stuff. The generated files in gulp-build are added to the manifest (since they're generated, and not in git). Finally, these are added via data-files as "share/stackviz-html". This is essentially standalone and can be moved, or symlinked to as required. The end result is that the .tar.gz created is installable on nodes an contains everything required to run stackviz. Documentation is updated. Change-Id: I64cbc7e90bd2610733c9d5c6275cce99f2571883 Signed-off-by: Paul Belanger <pabelanger@redhat.com>
37 lines
883 B
JavaScript
37 lines
883 B
JavaScript
'use strict';
|
|
|
|
var config = require('../config');
|
|
var http = require('http');
|
|
var express = require('express');
|
|
var gulp = require('gulp');
|
|
var gutil = require('gulp-util');
|
|
var morgan = require('morgan');
|
|
|
|
gulp.task('server', function() {
|
|
|
|
var server = express();
|
|
|
|
// log all requests to the console
|
|
server.use(morgan('dev'));
|
|
server.use(express.static(config.dist.root));
|
|
|
|
// Serve index.html for all routes to leave routing up to Angular
|
|
server.all('/*', function(req, res) {
|
|
res.sendFile('index.html', { root: 'gulp-build' });
|
|
});
|
|
|
|
// Start webserver if not already running
|
|
var s = http.createServer(server);
|
|
s.on('error', function(err){
|
|
if(err.code === 'EADDRINUSE'){
|
|
gutil.log('Development server is already started at port ' + config.serverPort);
|
|
}
|
|
else {
|
|
throw err;
|
|
}
|
|
});
|
|
|
|
s.listen(config.serverPort);
|
|
|
|
});
|