Skip to content

Commit

Permalink
Merge pull request #5 from w33ble/server-config
Browse files Browse the repository at this point in the history
Server config
  • Loading branch information
simianhacker committed Jan 21, 2015
2 parents 4f82813 + a863530 commit 23606c7
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 42 deletions.
5 changes: 0 additions & 5 deletions src/server/lib/appHeaders.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
var path = require('path');
var pkgPath = path.resolve(__dirname, '..', '..', '..', 'package.json');
var pkg = require(pkgPath);

module.exports = function () {
return function (req, res, next) {
res.header('X-App-Name', 'kibana');
res.header('X-App-Version', pkg.version);
next();
};
};
7 changes: 4 additions & 3 deletions tasks/config/mocha.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
var config = require('../utils/server-config');
var unitTestUrl = require('util').format('http://localhost:%d/test/unit/', config.kibana.port);

module.exports = {
options: {
log: true,
Expand All @@ -6,9 +9,7 @@ module.exports = {
},
unit: {
options: {
urls: [
'http://localhost:5601/test/unit/'
]
urls: [ unitTestUrl ]
}
}
};
13 changes: 0 additions & 13 deletions tasks/config/run.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
module.exports = function (grunt) {
var jrubyPath = grunt.config.get('jrubyPath');
var jruby = jrubyPath + '/bin/jruby';
var cmd = grunt.config.get('src') + '/server/bin/initialize';
var os = require('os');
var arch = os.arch();
var platform = os.platform();
Expand All @@ -22,16 +19,6 @@ module.exports = function (grunt) {
var args = ['-H', '127.0.0.1'];

var config = {
mri_server: {
options: options,
cmd: cmd,
args: args
},
jruby_server: {
options: options,
cmd: jruby,
args: [cmd].concat(args)
},
built_kibana: {
options: {
wait: false,
Expand Down
4 changes: 3 additions & 1 deletion tasks/config/saucelabs-mocha.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
var config = require('../utils/server-config');
var unitTestUrl = require('util').format('http://localhost:%d/test/unit/?saucelabs=true', config.kibana.port);
var buildId = 'test build';
if (process.env.TRAVIS_BUILD_ID) {
buildId = 'travis build #' + process.env.TRAVIS_BUILD_ID;
Expand All @@ -8,7 +10,7 @@ module.exports = {
options: {
username: 'kibana',
key: process.env.SAUCE_ACCESS_KEY,
urls: ['http://localhost:8000/test/unit/?saucelabs=true'],
urls: [ unitTestUrl ],
testname: 'Kibana Browser Tests',
build: buildId,
concurrency: 10,
Expand Down
2 changes: 1 addition & 1 deletion tasks/maybe_start_kibana.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = function (grunt) {
var config = require('../src/server/config');
var config = require('./utils/server-config');

var maybeStartServer = function (options) {
return function () {
Expand Down
4 changes: 3 additions & 1 deletion tasks/run_build.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
var os = require('os');
var config = require('./utils/server-config');

module.exports = function (grunt) {
grunt.registerTask('run_build', [
'build',
Expand All @@ -25,6 +27,6 @@ module.exports = function (grunt) {
});

grunt.registerTask('_open_built_kibana', function () {
require('opn')('http://localhost:5601');
require('opn')('http://localhost:' + config.kibana.port);
});
};
1 change: 1 addition & 0 deletions tasks/utils/server-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('../../src/server/config');
18 changes: 0 additions & 18 deletions tasks/wait_for_jruby.js

This file was deleted.

0 comments on commit 23606c7

Please sign in to comment.