mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 10:23:14 -04:00
The default behavior of the build task is to now apply the -snapshot suffix dynamically rather than us manually hardcoding and managing it within the source code itself. The `--release` flag will drop the -snapshot suffix on a build, which should be used for any release candidate. The default behavior of the build task has also changed to create rpm/deb packages as well. Since we've only confirmed that this works on linux, you can override that behavior by passing `skip-os-packages`. If you do not want to create any zip or tar.gz archives, you can pass `--skip-archives`.
23 lines
761 B
JavaScript
23 lines
761 B
JavaScript
import { execFileSync } from 'child_process';
|
|
import { join } from 'path';
|
|
|
|
export default (grunt) => {
|
|
grunt.registerTask('_rebuild:createArchives', function () {
|
|
const buildDir = grunt.config.get('buildDir');
|
|
const targetDir = grunt.config.get('target');
|
|
|
|
grunt.file.mkdir('target');
|
|
|
|
grunt.file.expand({ cwd: buildDir }, '*').forEach(build => {
|
|
const tar = join(targetDir, `${build}.tar.gz`);
|
|
execFileSync('tar', ['-zchf', tar, build], { cwd: buildDir });
|
|
|
|
const zip = join(targetDir, `${build}.zip`);
|
|
if (/windows/.test(build)) {
|
|
execFileSync('zip', ['-rq', '-ll', zip, build], { cwd: buildDir });
|
|
} else {
|
|
execFileSync('zip', ['-rq', zip, build], { cwd: buildDir });
|
|
}
|
|
});
|
|
});
|
|
};
|