diff --git a/Gruntfile.js b/Gruntfile.js index 5cfd30d92062..033852e2b10e 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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 diff --git a/tasks/build_task.js b/tasks/build_task.js index 11ac5f17c476..1aebd0fa6bde 100644 --- a/tasks/build_task.js +++ b/tasks/build_task.js @@ -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' ]); }; \ No newline at end of file diff --git a/tasks/options/clean.js b/tasks/options/clean.js index e469f3167e55..6cfb3e50aade 100644 --- a/tasks/options/clean.js +++ b/tasks/options/clean.js @@ -2,6 +2,7 @@ module.exports = function (config) { return { setup: [ '<%= kibanaCheckoutDir %>', '<%= buildDir %>' ], build: [ '<%= buildDir %>' ], + build_tmp: [ '<%= buildTempDir %>' ], package: ['<%= packageDir %>'] }; }; \ No newline at end of file diff --git a/tasks/options/compress.js b/tasks/options/compress.js index 6ed46e3c8a6f..31b563d9ea9f 100644 --- a/tasks/options/compress.js +++ b/tasks/options/compress.js @@ -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: '' } ] diff --git a/tasks/options/connect.js b/tasks/options/connect.js index 3c390dda2480..9bc9f4781d3b 100644 --- a/tasks/options/connect.js +++ b/tasks/options/connect.js @@ -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' } }; }; \ No newline at end of file diff --git a/tasks/options/copy.js b/tasks/options/copy.js index 2865e62cfcbe..0657d27627ee 100644 --- a/tasks/options/copy.js +++ b/tasks/options/copy.js @@ -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' } ] } diff --git a/tasks/options/replace.js b/tasks/options/replace.js index 5265482b5f53..2016993ddaa3 100644 --- a/tasks/options/replace.js +++ b/tasks/options/replace.js @@ -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 %>'} ] } }; diff --git a/tasks/options/shell.js b/tasks/options/shell.js index d6cc0b400a8c..f7b9d52f7d7d 100644 --- a/tasks/options/shell.js +++ b/tasks/options/shell.js @@ -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 %>', } } } diff --git a/tasks/options/symlink.js b/tasks/options/symlink.js deleted file mode 100644 index 32d3fb913174..000000000000 --- a/tasks/options/symlink.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = function (config) { - return { - build_npm: { - files: [ - { - src: 'node_modules', - dest: '<%= buildMergeDir %>/node_modules' - } - ] - } - }; -}; \ No newline at end of file diff --git a/tasks/server_task.js b/tasks/server_task.js index 50cee6147e74..d140d729612b 100644 --- a/tasks/server_task.js +++ b/tasks/server_task.js @@ -1,6 +1,7 @@ module.exports = function (grunt) { grunt.registerTask('server', function () { grunt.task.run([ + 'replace:dev_marvel_config', 'configureRewriteRules', 'connect' ]); diff --git a/tasks/setup_task.js b/tasks/setup_task.js index 31e2cb0ed2c6..6a3969a2ae1e 100644 --- a/tasks/setup_task.js +++ b/tasks/setup_task.js @@ -1,7 +1,6 @@ module.exports = function (grunt) { grunt.registerTask('setup', [ 'clean:setup', - 'gitclone:kibana', - 'replace:dev_marvel_config' + 'gitclone:kibana' ]); }; \ No newline at end of file