mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Renamed merge folder to tmp. Removed symlinking the nodes_module folder of kibana build. Build now leaves a _site folder with marvel+kibana in it. Server command always creates a new config.js from template
This commit is contained in:
parent
e6a85d6032
commit
b68dda7027
11 changed files with 40 additions and 58 deletions
|
@ -8,7 +8,6 @@ module.exports = function (grunt) {
|
|||
exporterDir: 'exporter',
|
||||
buildDir: 'build',
|
||||
packageDir: 'packages',
|
||||
tempDir: 'tmp',
|
||||
esPort: {
|
||||
dev: '"9200"',
|
||||
dist: "(window.location.port !== '' ? ':'+window.location.port : '')"
|
||||
|
@ -19,7 +18,7 @@ module.exports = function (grunt) {
|
|||
};
|
||||
|
||||
// more detailed config
|
||||
config['buildMergeDir'] = config['buildDir'] + '/merge'; // kibana and custom panels will be merged here
|
||||
config['buildTempDir'] = config['buildDir'] + '/tmp'; // kibana and custom panels will be merged here
|
||||
config['buildSiteDir'] = config['buildDir'] + '/_site'; // compressed minified marvel site will be outputted here
|
||||
|
||||
// Utility function to load plugin settings into the above config object
|
||||
|
|
|
@ -7,8 +7,9 @@ module.exports = function (grunt) {
|
|||
'copy:merge_kibana',
|
||||
'copy:merge_marvel',
|
||||
'replace:dist_marvel_config',
|
||||
'symlink:build_npm',
|
||||
'shell:build_kibana',
|
||||
'copy:plugin_to_marvel',
|
||||
'copy:kibana_build',
|
||||
'copy:exporter_build',
|
||||
'clean:build_tmp'
|
||||
]);
|
||||
};
|
|
@ -2,6 +2,7 @@ module.exports = function (config) {
|
|||
return {
|
||||
setup: [ '<%= kibanaCheckoutDir %>', '<%= buildDir %>' ],
|
||||
build: [ '<%= buildDir %>' ],
|
||||
build_tmp: [ '<%= buildTempDir %>' ],
|
||||
package: ['<%= packageDir %>']
|
||||
};
|
||||
};
|
|
@ -5,16 +5,10 @@ module.exports = function (config) {
|
|||
archive: '<%= packageDir %>/<%= pkg.name %>-<%= pkg.version %>.zip'
|
||||
},
|
||||
files: [
|
||||
{
|
||||
expand: true,
|
||||
cwd: '<%= buildMergeDir %>/dist',
|
||||
src: ['**/*'],
|
||||
dest: '_site'
|
||||
},
|
||||
{
|
||||
expand: true,
|
||||
cwd: '<%= buildDir %>',
|
||||
src: ['*.jar'],
|
||||
src: ['**/*'],
|
||||
dest: ''
|
||||
}
|
||||
]
|
||||
|
@ -24,16 +18,10 @@ module.exports = function (config) {
|
|||
archive: '<%= packageDir %>/<%= pkg.name %>-<%= pkg.version %>.tar.gz'
|
||||
},
|
||||
files: [
|
||||
{
|
||||
expand: true,
|
||||
cwd: '<%= buildMergeDir %>/dist',
|
||||
src: ['**/*'],
|
||||
dest: '_site'
|
||||
},
|
||||
{
|
||||
expand: true,
|
||||
cwd: '<%= buildDir %>',
|
||||
src: ['*.jar'],
|
||||
src: ['**/*'],
|
||||
dest: ''
|
||||
}
|
||||
]
|
||||
|
|
|
@ -1,24 +1,23 @@
|
|||
module.exports = function(config) {
|
||||
module.exports = function (config) {
|
||||
var rewriteRulesSnippet = require('grunt-connect-rewrite/lib/utils').rewriteRequest;
|
||||
return {
|
||||
options: {
|
||||
port: '<%= kibanaPort %>',
|
||||
hostname: '<%= kibanaHost %>',
|
||||
base: '.',
|
||||
keepalive: true,
|
||||
middleware: function (connect, options) {
|
||||
return [
|
||||
rewriteRulesSnippet, // RewriteRules support
|
||||
connect.static(require('path').resolve(options.base)) // mount filesystem
|
||||
];
|
||||
}
|
||||
}
|
||||
,
|
||||
options: {
|
||||
port: '<%= kibanaPort %>',
|
||||
hostname: '<%= kibanaHost %>',
|
||||
base: '.',
|
||||
keepalive: true,
|
||||
middleware: function (connect, options) {
|
||||
return [
|
||||
rewriteRulesSnippet, // RewriteRules support
|
||||
connect.static(require('path').resolve(options.base)) // mount filesystem
|
||||
];
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
'^/app/dashboards/marvel/(.*)$': '/dashboards/$1',
|
||||
'^/app/panels/marvel/(.*)$': '/panels/$1',
|
||||
'^/config.js$': '/<%= buildMergeDir %>/config.js',
|
||||
'^(.*)$': '<%= kibanaCheckoutDir %>/src/$1'
|
||||
'^/app/dashboards/marvel/(.*)$': '/dashboards/$1',
|
||||
'^/app/panels/marvel/(.*)$': '/panels/$1',
|
||||
'^/config.js$': '/<%= buildTempDir %>/config.js',
|
||||
'^(.*)$': '<%= kibanaCheckoutDir %>/src/$1'
|
||||
}
|
||||
};
|
||||
};
|
|
@ -1,16 +1,22 @@
|
|||
module.exports = function (config) {
|
||||
return {
|
||||
plugin_to_marvel: {
|
||||
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: '<%= buildMergeDir %>'
|
||||
dest: '<%= buildTempDir %>'
|
||||
},
|
||||
merge_marvel: {
|
||||
files: [
|
||||
|
@ -18,13 +24,13 @@ module.exports = function (config) {
|
|||
expand: true,
|
||||
cwd: 'dashboards',
|
||||
src: '**',
|
||||
dest: '<%= buildMergeDir %>/src/app/dashboards/marvel'
|
||||
dest: '<%= buildTempDir %>/src/app/dashboards/marvel'
|
||||
},
|
||||
{
|
||||
expand: true,
|
||||
cwd: 'panels',
|
||||
src: '**',
|
||||
dest: '<%= buildMergeDir %>/src/app/panels/marvel'
|
||||
dest: '<%= buildTempDir %>/src/app/panels/marvel'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -11,7 +11,7 @@ module.exports = function (config) {
|
|||
]
|
||||
},
|
||||
files: [
|
||||
{expand: true, flatten: true, src: ['./config.js'], dest: '<%= buildMergeDir %>'}
|
||||
{expand: true, flatten: true, src: ['./config.js'], dest: '<%= buildTempDir %>'}
|
||||
]
|
||||
},
|
||||
dist_marvel_config: {
|
||||
|
@ -24,7 +24,7 @@ module.exports = function (config) {
|
|||
]
|
||||
},
|
||||
files: [
|
||||
{expand: true, flatten: true, src: ['./config.js'], dest: '<%= buildMergeDir %>'}
|
||||
{expand: true, flatten: true, src: ['./config.js'], dest: '<%= buildTempDir %>'}
|
||||
]
|
||||
}
|
||||
};
|
||||
|
|
|
@ -22,12 +22,12 @@ module.exports = function (config) {
|
|||
},
|
||||
},
|
||||
build_kibana: {
|
||||
command: [ 'npm install', 'grunt build'].join("&&"),
|
||||
command: [ 'npm install', 'grunt build' ].join("&&"),
|
||||
options: {
|
||||
stdout: true,
|
||||
failOnError: true,
|
||||
execOptions: {
|
||||
cwd: '<%= buildMergeDir %>',
|
||||
cwd: '<%= buildTempDir %>',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
module.exports = function (config) {
|
||||
return {
|
||||
build_npm: {
|
||||
files: [
|
||||
{
|
||||
src: 'node_modules',
|
||||
dest: '<%= buildMergeDir %>/node_modules'
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
};
|
|
@ -1,6 +1,7 @@
|
|||
module.exports = function (grunt) {
|
||||
grunt.registerTask('server', function () {
|
||||
grunt.task.run([
|
||||
'replace:dev_marvel_config',
|
||||
'configureRewriteRules',
|
||||
'connect'
|
||||
]);
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
module.exports = function (grunt) {
|
||||
grunt.registerTask('setup', [
|
||||
'clean:setup',
|
||||
'gitclone:kibana',
|
||||
'replace:dev_marvel_config'
|
||||
'gitclone:kibana'
|
||||
]);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue