kibana/tasks/rebuild/create_archives.js
Court Ewing 834f56392e Apply -snapshot suffix during build task
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`.
2016-06-11 15:57:30 -04:00

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 });
}
});
});
};