Skip to content

Commit 5429a45

Browse files
jbudzkibanamachine
andcommitted
[build] Build docker contexts by default (#89934)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
1 parent 937bae1 commit 5429a45

File tree

3 files changed

+10
-16
lines changed

3 files changed

+10
-16
lines changed

src/dev/build/args.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ it('build default and oss dist for current platform, without packages, by defaul
3131
"createArchives": true,
3232
"createDebPackage": false,
3333
"createDockerCentOS": false,
34-
"createDockerContexts": false,
34+
"createDockerContexts": true,
3535
"createDockerUBI": false,
3636
"createRpmPackage": false,
3737
"downloadFreshNode": true,
@@ -79,7 +79,7 @@ it('limits packages if --rpm passed with --all-platforms', () => {
7979
"createArchives": true,
8080
"createDebPackage": false,
8181
"createDockerCentOS": false,
82-
"createDockerContexts": false,
82+
"createDockerContexts": true,
8383
"createDockerUBI": false,
8484
"createRpmPackage": true,
8585
"downloadFreshNode": true,
@@ -103,7 +103,7 @@ it('limits packages if --deb passed with --all-platforms', () => {
103103
"createArchives": true,
104104
"createDebPackage": true,
105105
"createDockerCentOS": false,
106-
"createDockerContexts": false,
106+
"createDockerContexts": true,
107107
"createDockerUBI": false,
108108
"createRpmPackage": false,
109109
"downloadFreshNode": true,
@@ -128,7 +128,7 @@ it('limits packages if --docker passed with --all-platforms', () => {
128128
"createArchives": true,
129129
"createDebPackage": false,
130130
"createDockerCentOS": true,
131-
"createDockerContexts": false,
131+
"createDockerContexts": true,
132132
"createDockerUBI": true,
133133
"createRpmPackage": false,
134134
"downloadFreshNode": true,
@@ -160,7 +160,7 @@ it('limits packages if --docker passed with --skip-docker-ubi and --all-platform
160160
"createArchives": true,
161161
"createDebPackage": false,
162162
"createDockerCentOS": true,
163-
"createDockerContexts": false,
163+
"createDockerContexts": true,
164164
"createDockerUBI": false,
165165
"createRpmPackage": false,
166166
"downloadFreshNode": true,

src/dev/build/args.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export function readCliArgs(argv: string[]) {
2222
'rpm',
2323
'deb',
2424
'docker-images',
25-
'docker-contexts',
25+
'skip-docker-contexts',
2626
'skip-docker-ubi',
2727
'skip-docker-centos',
2828
'release',
@@ -45,7 +45,6 @@ export function readCliArgs(argv: string[]) {
4545
rpm: null,
4646
deb: null,
4747
'docker-images': null,
48-
'docker-contexts': null,
4948
oss: null,
5049
'version-qualifier': '',
5150
},
@@ -72,7 +71,7 @@ export function readCliArgs(argv: string[]) {
7271

7372
// In order to build a docker image we always need
7473
// to generate all the platforms
75-
if (flags['docker-images'] || flags['docker-contexts']) {
74+
if (flags['docker-images']) {
7675
flags['all-platforms'] = true;
7776
}
7877

@@ -82,12 +81,7 @@ export function readCliArgs(argv: string[]) {
8281
}
8382

8483
// build all if no flags specified
85-
if (
86-
flags.rpm === null &&
87-
flags.deb === null &&
88-
flags['docker-images'] === null &&
89-
flags['docker-contexts'] === null
90-
) {
84+
if (flags.rpm === null && flags.deb === null && flags['docker-images'] === null) {
9185
return true;
9286
}
9387

@@ -106,7 +100,7 @@ export function readCliArgs(argv: string[]) {
106100
createDockerCentOS:
107101
isOsPackageDesired('docker-images') && !Boolean(flags['skip-docker-centos']),
108102
createDockerUBI: isOsPackageDesired('docker-images') && !Boolean(flags['skip-docker-ubi']),
109-
createDockerContexts: isOsPackageDesired('docker-contexts'),
103+
createDockerContexts: !Boolean(flags['skip-docker-contexts']),
110104
targetAllPlatforms: Boolean(flags['all-platforms']),
111105
};
112106

src/dev/build/build_distributables.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export async function buildDistributables(log: ToolingLog, options: BuildOptions
107107
}
108108

109109
if (options.createDockerContexts) {
110-
// control w/ --docker-contexts or --skip-os-packages
110+
// control w/ --skip-docker-contexts
111111
await run(Tasks.CreateDockerContexts);
112112
}
113113

0 commit comments

Comments
 (0)