Added kibana tag/branch/revision pinning.

This commit is contained in:
Boaz Leskes 2013-11-21 11:11:11 +01:00
parent b68dda7027
commit d64283f59e
6 changed files with 35 additions and 4 deletions

View file

@ -5,6 +5,7 @@ module.exports = function (grunt) {
var config = {
pkg: grunt.file.readJSON('package.json'),
kibanaCheckoutDir: './vendor/kibana',
kibanaRevision: 'master',
exporterDir: 'exporter',
buildDir: 'build',
packageDir: 'packages',

View file

@ -16,7 +16,6 @@
"grunt-contrib-copy": "~0.4.1",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-compress": "~0.5.2",
"grunt-git": "~0.1.6",
"grunt-s3": "~0.2.0-alpha.2",
"grunt-ngmin": "0.0.3",
"grunt-contrib-less": "~0.7.0",

View file

@ -1,6 +1,7 @@
module.exports = function (grunt) {
grunt.registerTask('build', [
'shell:verify_kibana_status',
'clean:build',
'shell:maven_clean',
'shell:maven_package',

View file

@ -2,7 +2,7 @@ module.exports = function (config) {
return {
kibana: {
options: {
repository: 'https://github.com/elasticsearch/kibana.git',
repository: 'git://github.com/elasticsearch/kibana.git',
directory: '<%= kibanaCheckoutDir %>'
}
}

View file

@ -30,6 +30,36 @@ module.exports = function (config) {
cwd: '<%= buildTempDir %>',
}
}
},
verify_kibana_status: {
command: [ 'test -z "`git status --porcelain`"', 'git diff-index --quiet <%= kibanaRevision %> --' ].join("&&"),
options: {
stdout: true,
stderr: true,
failOnError: true,
execOptions: {
cwd: '<%= kibanaCheckoutDir %>',
},
callback: function (error, stdout, stderr, cb) {
if (error) {
require("grunt").fatal("Kibana checkout is dirty or not on the right branch");
}
cb();
}
}
},
clone_kibana: {
command: [ 'git clone git://github.com/elasticsearch/kibana.git <%= kibanaCheckoutDir %>',
'cd <%= kibanaCheckoutDir %>',
'git checkout <%= kibanaRevision %>'
].join('&&'),
options: {
stdout: true,
stderr: true,
failOnError: true,
}
}
}
};
}
;

View file

@ -1,6 +1,6 @@
module.exports = function (grunt) {
grunt.registerTask('setup', [
'clean:setup',
'gitclone:kibana'
'shell:clone_kibana'
]);
};