Skip to content

Commit

Permalink
Merge branch '7.x' into backport/7.x/pr-102822
Browse files Browse the repository at this point in the history
  • Loading branch information
clintandrewhall authored Jun 30, 2021
2 parents 4d46c86 + 40f5350 commit 54ecf1b
Show file tree
Hide file tree
Showing 221 changed files with 5,020 additions and 3,843 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pip3 install --user ansible

```
# Build distributions
node scripts/build --all-platforms --debug --no-oss
node scripts/build --all-platforms --debug

cd test/package

Expand Down
2 changes: 0 additions & 2 deletions packages/kbn-ui-shared-deps/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ SRC_DEPS = [
"@npm//fflate",
"@npm//jquery",
"@npm//loader-utils",
# TODO: we can remove this once EUI patches the dependencies
"@npm//mdast-util-to-hast",
"@npm//mini-css-extract-plugin",
"@npm//moment",
"@npm//moment-timezone",
Expand Down
1 change: 1 addition & 0 deletions src/core/public/doc_links/doc_links_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ export class DocLinksService {
guide: `${KIBANA_DOCS}snapshot-repositories.html`,
changeIndexSettings: `${ELASTICSEARCH_DOCS}snapshots-restore-snapshot.html#change-index-settings-during-restore`,
createSnapshot: `${ELASTICSEARCH_DOCS}snapshots-take-snapshot.html`,
getSnapshot: `${ELASTICSEARCH_DOCS}get-snapshot-api.html`,
registerSharedFileSystem: `${ELASTICSEARCH_DOCS}snapshots-register-repository.html#snapshots-filesystem-repository`,
registerSourceOnly: `${ELASTICSEARCH_DOCS}snapshots-register-repository.html#snapshots-source-only-repository`,
registerUrl: `${ELASTICSEARCH_DOCS}snapshots-register-repository.html#snapshots-read-only-repository`,
Expand Down
4 changes: 2 additions & 2 deletions src/dev/build/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ node scripts/build --help
# build a release version
node scripts/build --release

# reuse already downloaded node executables, turn on debug logging, and only build the default distributable
node scripts/build --skip-node-download --debug --no-oss
# reuse already downloaded node executables, turn on debug logging
node scripts/build --skip-node-download --debug
```

# Fixing out of memory issues
Expand Down
14 changes: 0 additions & 14 deletions src/dev/build/args.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ it('build default and oss dist for current platform, without packages, by defaul
expect(readCliArgs(['node', 'scripts/build'])).toMatchInlineSnapshot(`
Object {
"buildOptions": Object {
"buildDefaultDist": true,
"buildOssDist": true,
"createArchives": true,
"createDebPackage": false,
"createDockerCentOS": false,
Expand All @@ -53,8 +51,6 @@ it('builds packages if --all-platforms is passed', () => {
expect(readCliArgs(['node', 'scripts/build', '--all-platforms'])).toMatchInlineSnapshot(`
Object {
"buildOptions": Object {
"buildDefaultDist": true,
"buildOssDist": true,
"createArchives": true,
"createDebPackage": true,
"createDockerCentOS": true,
Expand All @@ -80,8 +76,6 @@ it('limits packages if --rpm passed with --all-platforms', () => {
expect(readCliArgs(['node', 'scripts/build', '--all-platforms', '--rpm'])).toMatchInlineSnapshot(`
Object {
"buildOptions": Object {
"buildDefaultDist": true,
"buildOssDist": true,
"createArchives": true,
"createDebPackage": false,
"createDockerCentOS": false,
Expand All @@ -107,8 +101,6 @@ it('limits packages if --deb passed with --all-platforms', () => {
expect(readCliArgs(['node', 'scripts/build', '--all-platforms', '--deb'])).toMatchInlineSnapshot(`
Object {
"buildOptions": Object {
"buildDefaultDist": true,
"buildOssDist": true,
"createArchives": true,
"createDebPackage": true,
"createDockerCentOS": false,
Expand All @@ -135,8 +127,6 @@ it('limits packages if --docker passed with --all-platforms', () => {
.toMatchInlineSnapshot(`
Object {
"buildOptions": Object {
"buildDefaultDist": true,
"buildOssDist": true,
"createArchives": true,
"createDebPackage": false,
"createDockerCentOS": true,
Expand Down Expand Up @@ -170,8 +160,6 @@ it('limits packages if --docker passed with --skip-docker-ubi and --all-platform
).toMatchInlineSnapshot(`
Object {
"buildOptions": Object {
"buildDefaultDist": true,
"buildOssDist": true,
"createArchives": true,
"createDebPackage": false,
"createDockerCentOS": true,
Expand All @@ -198,8 +186,6 @@ it('limits packages if --all-platforms passed with --skip-docker-centos', () =>
.toMatchInlineSnapshot(`
Object {
"buildOptions": Object {
"buildDefaultDist": true,
"buildOssDist": true,
"createArchives": true,
"createDebPackage": true,
"createDockerCentOS": false,
Expand Down
5 changes: 0 additions & 5 deletions src/dev/build/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ export function readCliArgs(argv: string[]) {
const unknownFlags: string[] = [];
const flags = getopts(argv, {
boolean: [
'oss',
'no-oss',
'skip-archives',
'skip-initialize',
'skip-generic-folders',
Expand Down Expand Up @@ -48,7 +46,6 @@ export function readCliArgs(argv: string[]) {
rpm: null,
deb: null,
'docker-images': null,
oss: null,
'version-qualifier': '',
},
unknown: (flag) => {
Expand Down Expand Up @@ -94,8 +91,6 @@ export function readCliArgs(argv: string[]) {
const buildOptions: BuildOptions = {
isRelease: Boolean(flags.release),
versionQualifier: flags['version-qualifier'],
buildOssDist: flags.oss !== false,
buildDefaultDist: !flags.oss,
initialize: !Boolean(flags['skip-initialize']),
downloadFreshNode: !Boolean(flags['skip-node-download']),
createGenericFolders: !Boolean(flags['skip-generic-folders']),
Expand Down
4 changes: 0 additions & 4 deletions src/dev/build/build_distributables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ import * as Tasks from './tasks';

export interface BuildOptions {
isRelease: boolean;
buildOssDist: boolean;
buildDefaultDist: boolean;
downloadFreshNode: boolean;
initialize: boolean;
createGenericFolders: boolean;
Expand All @@ -37,8 +35,6 @@ export async function buildDistributables(log: ToolingLog, options: BuildOptions
const run = createRunner({
config,
log,
buildDefaultDist: options.buildDefaultDist,
buildOssDist: options.buildOssDist,
});

/**
Expand Down
2 changes: 0 additions & 2 deletions src/dev/build/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ if (showHelp) {
build the Kibana distributable
options:
--oss {dim Only produce the OSS distributable of Kibana}
--no-oss {dim Only produce the default distributable of Kibana}
--skip-archives {dim Don't produce tar/zip archives}
--skip-os-packages {dim Don't produce rpm/deb/docker packages}
--all-platforms {dim Produce archives for all platforms, not just this one}
Expand Down
38 changes: 11 additions & 27 deletions src/dev/build/lib/build.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,40 +43,24 @@ beforeEach(() => {
jest.clearAllMocks();
});

const ossBuild = new Build(config, true);
const defaultBuild = new Build(config, false);

describe('#isOss()', () => {
it('returns true for oss', () => {
expect(ossBuild.isOss()).toBe(true);
});

it('returns false for default build', () => {
expect(defaultBuild.isOss()).toBe(false);
});
});
const defaultBuild = new Build(config);

describe('#getName()', () => {
it('returns kibana for default build', () => {
expect(defaultBuild.getName()).toBe('kibana');
});

it('returns kibana-oss for oss', () => {
expect(ossBuild.getName()).toBe('kibana-oss');
});
});

describe('#getLogTag()', () => {
it('returns string with build name in it', () => {
expect(defaultBuild.getLogTag()).toContain(defaultBuild.getName());
expect(ossBuild.getLogTag()).toContain(ossBuild.getName());
});
});

describe('#resolvePath()', () => {
it('uses passed config to resolve a path relative to the repo', () => {
expect(ossBuild.resolvePath('bar')).toMatchInlineSnapshot(
`<absolute path>/build/kibana-oss/bar`
expect(defaultBuild.resolvePath('bar')).toMatchInlineSnapshot(
`<absolute path>/build/kibana/bar`
);
});

Expand All @@ -89,22 +73,22 @@ describe('#resolvePath()', () => {

describe('#resolvePathForPlatform()', () => {
it('uses config.resolveFromRepo(), config.getBuildVersion(), and platform.getBuildName() to create path', () => {
expect(ossBuild.resolvePathForPlatform(linuxPlatform, 'foo', 'bar')).toMatchInlineSnapshot(
`<absolute path>/build/oss/kibana-8.0.0-linux-x86_64/foo/bar`
expect(defaultBuild.resolvePathForPlatform(linuxPlatform, 'foo', 'bar')).toMatchInlineSnapshot(
`<absolute path>/build/default/kibana-8.0.0-linux-x86_64/foo/bar`
);
});
});

describe('#getPlatformArchivePath()', () => {
it('creates correct path for different platforms', () => {
expect(ossBuild.getPlatformArchivePath(linuxPlatform)).toMatchInlineSnapshot(
`<absolute path>/target/kibana-oss-8.0.0-linux-x86_64.tar.gz`
expect(defaultBuild.getPlatformArchivePath(linuxPlatform)).toMatchInlineSnapshot(
`<absolute path>/target/kibana-8.0.0-linux-x86_64.tar.gz`
);
expect(ossBuild.getPlatformArchivePath(linuxArmPlatform)).toMatchInlineSnapshot(
`<absolute path>/target/kibana-oss-8.0.0-linux-aarch64.tar.gz`
expect(defaultBuild.getPlatformArchivePath(linuxArmPlatform)).toMatchInlineSnapshot(
`<absolute path>/target/kibana-8.0.0-linux-aarch64.tar.gz`
);
expect(ossBuild.getPlatformArchivePath(windowsPlatform)).toMatchInlineSnapshot(
`<absolute path>/target/kibana-oss-8.0.0-windows-x86_64.zip`
expect(defaultBuild.getPlatformArchivePath(windowsPlatform)).toMatchInlineSnapshot(
`<absolute path>/target/kibana-8.0.0-windows-x86_64.zip`
);
});
});
12 changes: 4 additions & 8 deletions src/dev/build/lib/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,10 @@ import { Config } from './config';
import { Platform } from './platform';

export class Build {
private name = this.oss ? 'kibana-oss' : 'kibana';
private logTag = this.oss ? chalk`{magenta [kibana-oss]}` : chalk`{cyan [ kibana ]}`;
private name = 'kibana';
private logTag = chalk`{cyan [ kibana ]}`;

constructor(private config: Config, private oss: boolean) {}

isOss() {
return !!this.oss;
}
constructor(private config: Config) {}

resolvePath(...args: string[]) {
return this.config.resolveFromRepo('build', this.name, ...args);
Expand All @@ -28,7 +24,7 @@ export class Build {
resolvePathForPlatform(platform: Platform, ...args: string[]) {
return this.config.resolveFromRepo(
'build',
this.oss ? 'oss' : 'default',
'default',
`kibana-${this.config.getBuildVersion()}-${platform.getBuildName()}`,
...args
);
Expand Down
Loading

0 comments on commit 54ecf1b

Please sign in to comment.