[build] Build docker contexts by default (#89934)

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
Jonathan Budzenski 2021-02-02 15:02:13 -06:00
parent 937bae125e
commit 5429a45aa5
3 changed files with 10 additions and 16 deletions

View file

@ -31,7 +31,7 @@ it('build default and oss dist for current platform, without packages, by defaul
"createArchives": true,
"createDebPackage": false,
"createDockerCentOS": false,
"createDockerContexts": false,
"createDockerContexts": true,
"createDockerUBI": false,
"createRpmPackage": false,
"downloadFreshNode": true,
@ -79,7 +79,7 @@ it('limits packages if --rpm passed with --all-platforms', () => {
"createArchives": true,
"createDebPackage": false,
"createDockerCentOS": false,
"createDockerContexts": false,
"createDockerContexts": true,
"createDockerUBI": false,
"createRpmPackage": true,
"downloadFreshNode": true,
@ -103,7 +103,7 @@ it('limits packages if --deb passed with --all-platforms', () => {
"createArchives": true,
"createDebPackage": true,
"createDockerCentOS": false,
"createDockerContexts": false,
"createDockerContexts": true,
"createDockerUBI": false,
"createRpmPackage": false,
"downloadFreshNode": true,
@ -128,7 +128,7 @@ it('limits packages if --docker passed with --all-platforms', () => {
"createArchives": true,
"createDebPackage": false,
"createDockerCentOS": true,
"createDockerContexts": false,
"createDockerContexts": true,
"createDockerUBI": true,
"createRpmPackage": false,
"downloadFreshNode": true,
@ -160,7 +160,7 @@ it('limits packages if --docker passed with --skip-docker-ubi and --all-platform
"createArchives": true,
"createDebPackage": false,
"createDockerCentOS": true,
"createDockerContexts": false,
"createDockerContexts": true,
"createDockerUBI": false,
"createRpmPackage": false,
"downloadFreshNode": true,

View file

@ -22,7 +22,7 @@ export function readCliArgs(argv: string[]) {
'rpm',
'deb',
'docker-images',
'docker-contexts',
'skip-docker-contexts',
'skip-docker-ubi',
'skip-docker-centos',
'release',
@ -45,7 +45,6 @@ export function readCliArgs(argv: string[]) {
rpm: null,
deb: null,
'docker-images': null,
'docker-contexts': null,
oss: null,
'version-qualifier': '',
},
@ -72,7 +71,7 @@ export function readCliArgs(argv: string[]) {
// In order to build a docker image we always need
// to generate all the platforms
if (flags['docker-images'] || flags['docker-contexts']) {
if (flags['docker-images']) {
flags['all-platforms'] = true;
}
@ -82,12 +81,7 @@ export function readCliArgs(argv: string[]) {
}
// build all if no flags specified
if (
flags.rpm === null &&
flags.deb === null &&
flags['docker-images'] === null &&
flags['docker-contexts'] === null
) {
if (flags.rpm === null && flags.deb === null && flags['docker-images'] === null) {
return true;
}
@ -106,7 +100,7 @@ export function readCliArgs(argv: string[]) {
createDockerCentOS:
isOsPackageDesired('docker-images') && !Boolean(flags['skip-docker-centos']),
createDockerUBI: isOsPackageDesired('docker-images') && !Boolean(flags['skip-docker-ubi']),
createDockerContexts: isOsPackageDesired('docker-contexts'),
createDockerContexts: !Boolean(flags['skip-docker-contexts']),
targetAllPlatforms: Boolean(flags['all-platforms']),
};

View file

@ -107,7 +107,7 @@ export async function buildDistributables(log: ToolingLog, options: BuildOptions
}
if (options.createDockerContexts) {
// control w/ --docker-contexts or --skip-os-packages
// control w/ --skip-docker-contexts
await run(Tasks.CreateDockerContexts);
}