Added an index.html file to the root folder to redirect to kibana. Update build system, including a change to replace @@KIBANA_REVISION @@MARVEL_REVISION anywhere with their respective values. These are now part of a comment in the kibana config file and the base index.html

Closes #40
This commit is contained in:
Boaz Leskes 2014-01-22 10:54:24 +01:00
parent ef44560ce2
commit fbf8b289c1
8 changed files with 109 additions and 29 deletions

View file

@ -28,8 +28,9 @@ module.exports = function (grunt) {
// more detailed config
config['buildTempDir'] = config['buildDir'] + '/tmp'; // kibana and custom panels will be merged here
config['buildSiteDir'] = config['buildDir'] + '/_site'; // compressed minified marvel site will be output here
config['buildSiteDir'] = config['buildDir'] + '/_site';
config['buildSenseDir'] = config['buildSiteDir'] + '/sense'; // compressed minified sense site will be here
config['buildKibanaDir'] = config['buildSiteDir'] + '/kibana'; // compressed minified marvel's kibana site will be output here
// Utility function to load plugin settings into the above config object
function loadConfig(config, path) {

19
index.html Normal file
View file

@ -0,0 +1,19 @@
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1;url=kibana/index.html">
<script type="text/javascript">
window.location.href = "kibana/index.html"
</script>
<title>Page Redirection</title>
</head>
<body>
If you are not redirected automatically, follow the <a href='kibana/index.html'>link to kibana</a>
<!--
Built on:
marvel commit: @@MARVEL_REVISION
kibana commit: @@KIBANA_REVISION
-->
</body>
</html>

View file

@ -70,3 +70,9 @@ define(['settings'],
s.stats_report_url = @@stats_report_url;
return s;
});
/**
* Built on:
* marvel commit: @@MARVEL_REVISION
* kibana commit: @@KIBANA_REVISION
*/

View file

@ -5,23 +5,33 @@ module.exports = function (grunt) {
grunt.registerTask('build', [
'shell:verify_kibana_status',
'jshint:kibana',
'jshint',
'clean:build',
'build:load_git_versions',
'shell:maven_clean',
'shell:maven_package',
'copy:merge_kibana',
'copy:merge_marvel',
'copy:merge_marvel_kibana',
'replace:dist_marvel_config',
'shell:build_kibana',
'copy:kibana_build',
'build_sense',
'copy:exporter_build',
'clean:build_tmp'
'copy:artifacts_to_build',
'clean:build_tmp',
'replace:git_commits'
]);
grunt.registerTask('build_sense', [
'jshint:sense',
'requirejs:build_sense',
'clean:sense_build_tests'
]);
grunt.registerTask('build:load_git_versions', function () {
grunt.event.once('git-describe', function (desc) {
grunt.config.set('kibanaCommit', desc.object);
grunt.event.once('git-describe', function (desc) {
grunt.config.set('marvelCommit', desc.object);
});
grunt.task.run('git-describe:marvel');
});
grunt.task.run('git-describe:kibana');
});
};

View file

@ -1,25 +1,36 @@
module.exports = function (config) {
return {
exporter_build: {
cwd: '<%= exporterDir %>/target',
expand: true,
src: ['<%= pkg.name %>-<%= pkg.version %>.jar'],
dest: '<%= buildDir %>'
},
kibana_build: {
cwd: '<%= buildTempDir %>/dist',
expand: true,
src: ['**'],
dest: '<%= buildSiteDir %>'
},
merge_kibana: {
expand: true,
cwd: '<%= kibanaCheckoutDir %>',
src: [ '**', '.jshintrc'],
dest: '<%= buildTempDir %>'
},
merge_marvel: {
artifacts_to_build: {
files: [
{
// agent jar
cwd: '<%= exporterDir %>/target',
expand: true,
src: ['<%= pkg.name %>-<%= pkg.version %>.jar'],
dest: '<%= buildDir %>'
},
{
// merged kibana
cwd: '<%= buildTempDir %>/dist',
expand: true,
src: ['**'],
dest: '<%= buildKibanaDir %>'
},
{
cwd: '.',
expand: true,
src: ['index.html'],
dest: '<%= buildSiteDir %>'
}
]},
merge_marvel_kibana: {
files: [
{
expand: true,
cwd: '<%= kibanaCheckoutDir %>',
src: [ '**', '.jshintrc'],
dest: '<%= buildTempDir %>'
},
{
expand: true,
cwd: 'dashboards',

View file

@ -0,0 +1,14 @@
module.exports = function(config) {
return {
marvel: {
options: {
cwd: '.'
}
},
kibana: {
options: {
cwd: '<%= kibanaCheckoutDir %>'
}
}
};
};

View file

@ -42,6 +42,25 @@ module.exports = function (config) {
files: [
{expand: true, flatten: true, src: ['./kibana/config.js'], dest: '<%= buildTempDir %>/src/'}
]
},
git_commits: {
options: {
patterns: [
{
match: 'MARVEL_REVISION',
replacement: '<%= marvelCommit %>'
},
{
match: 'KIBANA_REVISION',
replacement: '<%= kibanaCommit %>'
}
]
},
files: [
{
cwd: '<%= buildSiteDir %>',
expand: true, src: ['**/*'], dest: '<%= buildSiteDir %>/'}
]
}
};
}
};

View file

@ -23,7 +23,7 @@ module.exports = function (grunt) {
optimize: 'uglify2',
optimizeAllPluginResources: true,
preserveLicenseComments: true,
generateSourceMaps: true,
generateSourceMaps: false,
uglify2: {
max_line_len: 100