From 76d6606a212a8cfb880afd1076e3a5ce5a47784f Mon Sep 17 00:00:00 2001 From: Jonathan Budzenski Date: Tue, 2 Feb 2021 15:02:13 -0600 Subject: [PATCH] [build] Build docker contexts by default (#89934) Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> --- src/dev/build/args.test.ts | 10 +++++----- src/dev/build/args.ts | 14 ++++---------- src/dev/build/build_distributables.ts | 2 +- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/src/dev/build/args.test.ts b/src/dev/build/args.test.ts index 745b9d0b910c..798f7db05623 100644 --- a/src/dev/build/args.test.ts +++ b/src/dev/build/args.test.ts @@ -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, diff --git a/src/dev/build/args.ts b/src/dev/build/args.ts index 2d26d7db3a5e..e51043ea40fe 100644 --- a/src/dev/build/args.ts +++ b/src/dev/build/args.ts @@ -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']), }; diff --git a/src/dev/build/build_distributables.ts b/src/dev/build/build_distributables.ts index df4ba45517cc..771401a49a24 100644 --- a/src/dev/build/build_distributables.ts +++ b/src/dev/build/build_distributables.ts @@ -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); }