Merge branch 'pr/3151'

This commit is contained in:
Rashid Khan 2015-02-26 13:50:23 -07:00
commit 0c64bffd34
4 changed files with 15 additions and 3 deletions

View file

@ -44,7 +44,8 @@ var config = module.exports = {
bundled_plugins_folder : path.resolve(public_folder, 'plugins'),
kibana : kibana,
package : require(packagePath),
htpasswd : htpasswdPath
htpasswd : htpasswdPath,
buildNum : '@@buildNum'
};
config.plugins = listPlugins(config);

View file

@ -14,11 +14,18 @@ module.exports = function (response) {
var body = _.find(response.hits.hits, isUpgradeable);
if (!body) return Promise.resolve();
// if the build number is still the template string (which it wil be in development)
// then we need to set it to the max interger. Otherwise we will set it to the build num
body._source.buildNum = (/^@@/.test(config.buildNum)) ? Math.pow(2, 53) - 1 : parseInt(config.buildNum, 10);
return client.create({
index: config.kibana.kibana_index,
type: 'config',
body: body._source,
id: config.package.version
}).catch(function (err) {
// Ignore document already exists exceptions for beta and snapshot upgrades.
if (/DocumentAlreadyExistsException/.test(err.message) && /beta|snapshot/.test(config.package.version)) return;
throw err;
});
};

View file

@ -33,7 +33,7 @@ module.exports = function (grunt) {
{
expand: true,
cwd: '<%= server %>/config/',
src: '**',
src: '*.yml',
dest: '<%= build %>/kibana/config'
},
{

View file

@ -22,6 +22,10 @@ module.exports = function (grunt) {
{
src: [join(src, 'server', 'bin', 'kibana.bat')],
dest: join(build, 'dist', 'kibana', 'bin', 'kibana.bat')
},
{
src: [join(src, 'server', 'config', 'index.js')],
dest: join(build, 'dist', 'kibana', 'src', 'config', 'index.js')
}
]
},