Skip to content

Commit

Permalink
[build] Build docker contexts by default (#89934)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
jbudz and kibanamachine authored Feb 2, 2021
1 parent 43faa76 commit 76d6606
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
10 changes: 5 additions & 5 deletions src/dev/build/args.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
14 changes: 4 additions & 10 deletions src/dev/build/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -45,7 +45,6 @@ export function readCliArgs(argv: string[]) {
rpm: null,
deb: null,
'docker-images': null,
'docker-contexts': null,
oss: null,
'version-qualifier': '',
},
Expand All @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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']),
};

Expand Down
2 changes: 1 addition & 1 deletion src/dev/build/build_distributables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 76d6606

Please sign in to comment.