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`.
36 lines
1.2 KiB
JavaScript
36 lines
1.2 KiB
JavaScript
import { execFileSync } from 'child_process';
|
|
import { readFileSync, writeFileSync } from 'fs';
|
|
import { join } from 'path';
|
|
import { createInterface } from 'readline';
|
|
|
|
export default (grunt) => {
|
|
grunt.registerTask('_rebuild:confirm', function () {
|
|
const newVersion = grunt.option('buildversion') || grunt.config.get('pkg').version;
|
|
const newBuildNum = grunt.option('buildnum') || grunt.config.get('build.number');
|
|
const newSha = grunt.option('buildsha') || grunt.config.get('build.sha');
|
|
|
|
grunt.config('rebuild', { newVersion, newBuildNum, newSha });
|
|
|
|
grunt.log.writeln('Targets will be rebuilt with the following:');
|
|
grunt.log.writeln(`Version: ${newVersion}`);
|
|
grunt.log.writeln(`Build number: ${newBuildNum}`);
|
|
grunt.log.writeln(`Build sha: ${newSha}`);
|
|
|
|
const rl = createInterface({
|
|
input: process.stdin,
|
|
output: process.stdout
|
|
});
|
|
|
|
rl.on('close', this.async());
|
|
|
|
rl.question('Do you want to rebuild these packages? [N/y] ', (resp) => {
|
|
const answer = resp.toLowerCase().trim();
|
|
|
|
if (answer === 'y') {
|
|
grunt.config.set('rebuild.continue', true);
|
|
}
|
|
|
|
rl.close();
|
|
});
|
|
});
|
|
};
|