kibana/tasks/build/versioned_links.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

29 lines
901 B
JavaScript

module.exports = function (grunt) {
let { basename, resolve } = require('path');
let { forOwn } = require('lodash');
let exec = require('../utils/exec').silent;
grunt.registerTask('_build:versionedLinks', function () {
let rootPath = grunt.config.get('root');
let buildFiles = grunt.file.expand('build/kibana/{*,.*}')
.map(function (file) {
return resolve(rootPath, file);
});
let transferFiles = (source, link) => exec('cp', ['-r', source, link]);
grunt.config.get('platforms').forEach(function (platform) {
grunt.file.mkdir(platform.buildDir);
// link all files at the root of the build
buildFiles.forEach(function (source) {
transferFiles(source, resolve(platform.buildDir, basename(source)));
});
// link the node modules
transferFiles(platform.nodeDir, resolve(platform.buildDir, 'node'));
});
});
};