mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Revert "[build] Remove OSS builds (#100577)"
This reverts commit b2d76a6cd3
.
This commit is contained in:
parent
51767e7cb9
commit
24661fe208
20 changed files with 225 additions and 61 deletions
|
@ -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
|
||||
node scripts/build --skip-node-download --debug
|
||||
# reuse already downloaded node executables, turn on debug logging, and only build the default distributable
|
||||
node scripts/build --skip-node-download --debug --no-oss
|
||||
```
|
||||
|
||||
# Fixing out of memory issues
|
||||
|
|
|
@ -27,6 +27,7 @@ it('build default and oss dist for current platform, without packages, by defaul
|
|||
Object {
|
||||
"buildOptions": Object {
|
||||
"buildDefaultDist": true,
|
||||
"buildOssDist": true,
|
||||
"createArchives": true,
|
||||
"createDebPackage": false,
|
||||
"createDockerCentOS": false,
|
||||
|
@ -53,6 +54,7 @@ it('builds packages if --all-platforms is passed', () => {
|
|||
Object {
|
||||
"buildOptions": Object {
|
||||
"buildDefaultDist": true,
|
||||
"buildOssDist": true,
|
||||
"createArchives": true,
|
||||
"createDebPackage": true,
|
||||
"createDockerCentOS": true,
|
||||
|
@ -79,6 +81,7 @@ it('limits packages if --rpm passed with --all-platforms', () => {
|
|||
Object {
|
||||
"buildOptions": Object {
|
||||
"buildDefaultDist": true,
|
||||
"buildOssDist": true,
|
||||
"createArchives": true,
|
||||
"createDebPackage": false,
|
||||
"createDockerCentOS": false,
|
||||
|
@ -105,6 +108,7 @@ it('limits packages if --deb passed with --all-platforms', () => {
|
|||
Object {
|
||||
"buildOptions": Object {
|
||||
"buildDefaultDist": true,
|
||||
"buildOssDist": true,
|
||||
"createArchives": true,
|
||||
"createDebPackage": true,
|
||||
"createDockerCentOS": false,
|
||||
|
@ -132,6 +136,7 @@ it('limits packages if --docker passed with --all-platforms', () => {
|
|||
Object {
|
||||
"buildOptions": Object {
|
||||
"buildDefaultDist": true,
|
||||
"buildOssDist": true,
|
||||
"createArchives": true,
|
||||
"createDebPackage": false,
|
||||
"createDockerCentOS": true,
|
||||
|
@ -166,6 +171,7 @@ it('limits packages if --docker passed with --skip-docker-ubi and --all-platform
|
|||
Object {
|
||||
"buildOptions": Object {
|
||||
"buildDefaultDist": true,
|
||||
"buildOssDist": true,
|
||||
"createArchives": true,
|
||||
"createDebPackage": false,
|
||||
"createDockerCentOS": true,
|
||||
|
@ -193,6 +199,7 @@ it('limits packages if --all-platforms passed with --skip-docker-centos', () =>
|
|||
Object {
|
||||
"buildOptions": Object {
|
||||
"buildDefaultDist": true,
|
||||
"buildOssDist": true,
|
||||
"createArchives": true,
|
||||
"createDebPackage": true,
|
||||
"createDockerCentOS": false,
|
||||
|
|
|
@ -15,6 +15,8 @@ export function readCliArgs(argv: string[]) {
|
|||
const unknownFlags: string[] = [];
|
||||
const flags = getopts(argv, {
|
||||
boolean: [
|
||||
'oss',
|
||||
'no-oss',
|
||||
'skip-archives',
|
||||
'skip-initialize',
|
||||
'skip-generic-folders',
|
||||
|
@ -92,6 +94,7 @@ 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']),
|
||||
|
|
|
@ -13,6 +13,7 @@ import * as Tasks from './tasks';
|
|||
|
||||
export interface BuildOptions {
|
||||
isRelease: boolean;
|
||||
buildOssDist: boolean;
|
||||
buildDefaultDist: boolean;
|
||||
downloadFreshNode: boolean;
|
||||
initialize: boolean;
|
||||
|
@ -37,6 +38,7 @@ export async function buildDistributables(log: ToolingLog, options: BuildOptions
|
|||
config,
|
||||
log,
|
||||
buildDefaultDist: options.buildDefaultDist,
|
||||
buildOssDist: options.buildOssDist,
|
||||
});
|
||||
|
||||
/**
|
||||
|
|
|
@ -33,6 +33,8 @@ 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}
|
||||
|
|
|
@ -43,24 +43,40 @@ beforeEach(() => {
|
|||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
const defaultBuild = new Build(config);
|
||||
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);
|
||||
});
|
||||
});
|
||||
|
||||
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(defaultBuild.resolvePath('bar')).toMatchInlineSnapshot(
|
||||
`<absolute path>/build/kibana/bar`
|
||||
expect(ossBuild.resolvePath('bar')).toMatchInlineSnapshot(
|
||||
`<absolute path>/build/kibana-oss/bar`
|
||||
);
|
||||
});
|
||||
|
||||
|
@ -73,27 +89,28 @@ describe('#resolvePath()', () => {
|
|||
|
||||
describe('#resolvePathForPlatform()', () => {
|
||||
it('uses config.resolveFromRepo(), config.getBuildVersion(), and platform.getBuildName() to create path', () => {
|
||||
expect(defaultBuild.resolvePathForPlatform(linuxPlatform, 'foo', 'bar')).toMatchInlineSnapshot(
|
||||
`<absolute path>/build/default/kibana-8.0.0-linux-x86_64/foo/bar`
|
||||
expect(ossBuild.resolvePathForPlatform(linuxPlatform, 'foo', 'bar')).toMatchInlineSnapshot(
|
||||
`<absolute path>/build/oss/kibana-8.0.0-linux-x86_64/foo/bar`
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe('#getPlatformArchivePath()', () => {
|
||||
it('creates correct path for different platforms', () => {
|
||||
expect(defaultBuild.getPlatformArchivePath(linuxPlatform)).toMatchInlineSnapshot(
|
||||
`<absolute path>/target/kibana-8.0.0-linux-x86_64.tar.gz`
|
||||
expect(ossBuild.getPlatformArchivePath(linuxPlatform)).toMatchInlineSnapshot(
|
||||
`<absolute path>/target/kibana-oss-8.0.0-linux-x86_64.tar.gz`
|
||||
);
|
||||
expect(defaultBuild.getPlatformArchivePath(linuxArmPlatform)).toMatchInlineSnapshot(
|
||||
`<absolute path>/target/kibana-8.0.0-linux-aarch64.tar.gz`
|
||||
expect(ossBuild.getPlatformArchivePath(linuxArmPlatform)).toMatchInlineSnapshot(
|
||||
`<absolute path>/target/kibana-oss-8.0.0-linux-aarch64.tar.gz`
|
||||
);
|
||||
expect(defaultBuild.getPlatformArchivePath(windowsPlatform)).toMatchInlineSnapshot(
|
||||
`<absolute path>/target/kibana-8.0.0-windows-x86_64.zip`
|
||||
expect(ossBuild.getPlatformArchivePath(windowsPlatform)).toMatchInlineSnapshot(
|
||||
`<absolute path>/target/kibana-oss-8.0.0-windows-x86_64.zip`
|
||||
);
|
||||
});
|
||||
|
||||
describe('#getRootDirectory()', () => {
|
||||
it('creates correct root directory name', () => {
|
||||
expect(ossBuild.getRootDirectory()).toMatchInlineSnapshot(`"kibana-oss-8.0.0"`);
|
||||
expect(defaultBuild.getRootDirectory()).toMatchInlineSnapshot(`"kibana-8.0.0"`);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -12,10 +12,14 @@ import { Config } from './config';
|
|||
import { Platform } from './platform';
|
||||
|
||||
export class Build {
|
||||
private name = 'kibana';
|
||||
private logTag = chalk`{cyan [ kibana ]}`;
|
||||
private name = this.oss ? 'kibana-oss' : 'kibana';
|
||||
private logTag = this.oss ? chalk`{magenta [kibana-oss]}` : chalk`{cyan [ kibana ]}`;
|
||||
|
||||
constructor(private config: Config) {}
|
||||
constructor(private config: Config, private oss: boolean) {}
|
||||
|
||||
isOss() {
|
||||
return !!this.oss;
|
||||
}
|
||||
|
||||
resolvePath(...args: string[]) {
|
||||
return this.config.resolveFromRepo('build', this.name, ...args);
|
||||
|
@ -24,7 +28,7 @@ export class Build {
|
|||
resolvePathForPlatform(platform: Platform, ...args: string[]) {
|
||||
return this.config.resolveFromRepo(
|
||||
'build',
|
||||
'default',
|
||||
this.oss ? 'oss' : 'default',
|
||||
`kibana-${this.config.getBuildVersion()}-${platform.getBuildName()}`,
|
||||
...args
|
||||
);
|
||||
|
|
|
@ -45,7 +45,7 @@ beforeEach(() => {
|
|||
jest.clearAllMocks();
|
||||
});
|
||||
|
||||
const setup = async (opts: { buildDefaultDist: boolean }) => {
|
||||
const setup = async (opts: { buildDefaultDist: boolean; buildOssDist: boolean }) => {
|
||||
const config = await Config.create({
|
||||
isRelease: true,
|
||||
targetAllPlatforms: true,
|
||||
|
@ -61,10 +61,48 @@ const setup = async (opts: { buildDefaultDist: boolean }) => {
|
|||
return { config, run };
|
||||
};
|
||||
|
||||
describe('default dist', () => {
|
||||
describe('buildOssDist = true, buildDefaultDist = true', () => {
|
||||
it('runs global task once, passing config and log', async () => {
|
||||
const { config, run } = await setup({
|
||||
buildDefaultDist: true,
|
||||
buildOssDist: true,
|
||||
});
|
||||
|
||||
const mock = jest.fn();
|
||||
|
||||
await run({
|
||||
global: true,
|
||||
description: 'foo',
|
||||
run: mock,
|
||||
});
|
||||
|
||||
expect(mock).toHaveBeenCalledTimes(1);
|
||||
expect(mock).toHaveBeenLastCalledWith(config, log, [expect.any(Build), expect.any(Build)]);
|
||||
});
|
||||
|
||||
it('calls local tasks twice, passing each build', async () => {
|
||||
const { config, run } = await setup({
|
||||
buildDefaultDist: true,
|
||||
buildOssDist: true,
|
||||
});
|
||||
|
||||
const mock = jest.fn();
|
||||
|
||||
await run({
|
||||
description: 'foo',
|
||||
run: mock,
|
||||
});
|
||||
|
||||
expect(mock).toHaveBeenCalledTimes(2);
|
||||
expect(mock).toHaveBeenCalledWith(config, log, expect.any(Build));
|
||||
});
|
||||
});
|
||||
|
||||
describe('just default dist', () => {
|
||||
it('runs global task once, passing config and log', async () => {
|
||||
const { config, run } = await setup({
|
||||
buildDefaultDist: true,
|
||||
buildOssDist: false,
|
||||
});
|
||||
|
||||
const mock = jest.fn();
|
||||
|
@ -82,6 +120,7 @@ describe('default dist', () => {
|
|||
it('calls local tasks once, passing the default build', async () => {
|
||||
const { config, run } = await setup({
|
||||
buildDefaultDist: true,
|
||||
buildOssDist: false,
|
||||
});
|
||||
|
||||
const mock = jest.fn();
|
||||
|
@ -93,6 +132,53 @@ describe('default dist', () => {
|
|||
|
||||
expect(mock).toHaveBeenCalledTimes(1);
|
||||
expect(mock).toHaveBeenCalledWith(config, log, expect.any(Build));
|
||||
const [args] = mock.mock.calls;
|
||||
const [, , build] = args;
|
||||
if (build.isOss()) {
|
||||
throw new Error('expected build to be the default dist, not the oss dist');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
describe('just oss dist', () => {
|
||||
it('runs global task once, passing config and log', async () => {
|
||||
const { config, run } = await setup({
|
||||
buildDefaultDist: false,
|
||||
buildOssDist: true,
|
||||
});
|
||||
|
||||
const mock = jest.fn();
|
||||
|
||||
await run({
|
||||
global: true,
|
||||
description: 'foo',
|
||||
run: mock,
|
||||
});
|
||||
|
||||
expect(mock).toHaveBeenCalledTimes(1);
|
||||
expect(mock).toHaveBeenLastCalledWith(config, log, [expect.any(Build)]);
|
||||
});
|
||||
|
||||
it('calls local tasks once, passing the oss build', async () => {
|
||||
const { config, run } = await setup({
|
||||
buildDefaultDist: false,
|
||||
buildOssDist: true,
|
||||
});
|
||||
|
||||
const mock = jest.fn();
|
||||
|
||||
await run({
|
||||
description: 'foo',
|
||||
run: mock,
|
||||
});
|
||||
|
||||
expect(mock).toHaveBeenCalledTimes(1);
|
||||
expect(mock).toHaveBeenCalledWith(config, log, expect.any(Build));
|
||||
const [args] = mock.mock.calls;
|
||||
const [, , build] = args;
|
||||
if (!build.isOss()) {
|
||||
throw new Error('expected build to be the oss dist, not the default dist');
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -100,6 +186,7 @@ describe('task rejection', () => {
|
|||
it('rejects, logs error, and marks error logged', async () => {
|
||||
const { run } = await setup({
|
||||
buildDefaultDist: true,
|
||||
buildOssDist: false,
|
||||
});
|
||||
|
||||
const error = new Error('FOO');
|
||||
|
@ -128,6 +215,7 @@ describe('task rejection', () => {
|
|||
it('just rethrows errors that have already been logged', async () => {
|
||||
const { run } = await setup({
|
||||
buildDefaultDist: true,
|
||||
buildOssDist: false,
|
||||
});
|
||||
|
||||
const error = markErrorLogged(new Error('FOO'));
|
||||
|
|
|
@ -16,6 +16,7 @@ import { Config } from './config';
|
|||
interface Options {
|
||||
config: Config;
|
||||
log: ToolingLog;
|
||||
buildOssDist: boolean;
|
||||
buildDefaultDist: boolean;
|
||||
}
|
||||
|
||||
|
@ -31,7 +32,7 @@ export interface Task {
|
|||
run(config: Config, log: ToolingLog, build: Build): Promise<void>;
|
||||
}
|
||||
|
||||
export function createRunner({ config, log, buildDefaultDist }: Options) {
|
||||
export function createRunner({ config, log, buildOssDist, buildDefaultDist }: Options) {
|
||||
async function execTask(desc: string, task: Task | GlobalTask, lastArg: any) {
|
||||
log.info(desc);
|
||||
log.indent(4);
|
||||
|
@ -63,7 +64,10 @@ export function createRunner({ config, log, buildDefaultDist }: Options) {
|
|||
|
||||
const builds: Build[] = [];
|
||||
if (buildDefaultDist) {
|
||||
builds.push(new Build(config));
|
||||
builds.push(new Build(config, false));
|
||||
}
|
||||
if (buildOssDist) {
|
||||
builds.push(new Build(config, true));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -27,7 +27,7 @@ export const BuildKibanaPlatformPlugins: Task = {
|
|||
repoRoot: REPO_ROOT,
|
||||
outputRoot: build.resolvePath(),
|
||||
cache: false,
|
||||
oss: false,
|
||||
oss: build.isOss(),
|
||||
examples: false,
|
||||
watch: false,
|
||||
dist: true,
|
||||
|
|
|
@ -63,6 +63,7 @@ export const BuildBazelPackages: Task = {
|
|||
await buildBazelProductionProjects({
|
||||
kibanaRoot: config.resolveFromRepo(),
|
||||
buildRoot: build.resolvePath(),
|
||||
onlyOSS: build.isOss(),
|
||||
});
|
||||
},
|
||||
};
|
||||
|
@ -74,6 +75,7 @@ export const BuildPackages: Task = {
|
|||
await buildNonBazelProductionProjects({
|
||||
kibanaRoot: config.resolveFromRepo(),
|
||||
buildRoot: build.resolvePath(),
|
||||
onlyOSS: build.isOss(),
|
||||
});
|
||||
},
|
||||
};
|
||||
|
|
|
@ -77,14 +77,14 @@ export const CreateArchives: Task = {
|
|||
const metrics: CiStatsMetric[] = [];
|
||||
for (const { format, path, fileCount } of archives) {
|
||||
metrics.push({
|
||||
group: `distributable size`,
|
||||
group: `${build.isOss() ? 'oss ' : ''}distributable size`,
|
||||
id: format,
|
||||
value: (await asyncStat(path)).size,
|
||||
});
|
||||
|
||||
metrics.push({
|
||||
group: 'distributable file count',
|
||||
id: 'default',
|
||||
id: build.isOss() ? 'oss' : 'default',
|
||||
value: fileCount,
|
||||
});
|
||||
}
|
||||
|
|
|
@ -15,17 +15,21 @@ export const InstallChromium = {
|
|||
description: 'Installing Chromium',
|
||||
|
||||
async run(config, log, build) {
|
||||
for (const platform of config.getNodePlatforms()) {
|
||||
log.info(`Installing Chromium for ${platform.getName()}-${platform.getArchitecture()}`);
|
||||
if (build.isOss()) {
|
||||
return;
|
||||
} else {
|
||||
for (const platform of config.getNodePlatforms()) {
|
||||
log.info(`Installing Chromium for ${platform.getName()}-${platform.getArchitecture()}`);
|
||||
|
||||
const { binaryPath$ } = installBrowser(
|
||||
// TODO: https://github.com/elastic/kibana/issues/72496
|
||||
log,
|
||||
build.resolvePathForPlatform(platform, 'x-pack/plugins/reporting/chromium'),
|
||||
platform.getName(),
|
||||
platform.getArchitecture()
|
||||
);
|
||||
await binaryPath$.pipe(first()).toPromise();
|
||||
const { binaryPath$ } = installBrowser(
|
||||
// TODO: https://github.com/elastic/kibana/issues/72496
|
||||
log,
|
||||
build.resolvePathForPlatform(platform, 'x-pack/plugins/reporting/chromium'),
|
||||
platform.getName(),
|
||||
platform.getArchitecture()
|
||||
);
|
||||
await binaryPath$.pipe(first()).toPromise();
|
||||
}
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
@ -8,13 +8,23 @@
|
|||
|
||||
import { write, read, Task } from '../lib';
|
||||
|
||||
const LICENSE_SEPARATOR = `\n------------------------------------------------------------------------\n\n`;
|
||||
|
||||
export const UpdateLicenseFile: Task = {
|
||||
description: 'Updating LICENSE.txt file',
|
||||
|
||||
async run(config, log, build) {
|
||||
const elasticLicense = await read(config.resolveFromRepo('licenses/ELASTIC-LICENSE-2.0.txt'));
|
||||
|
||||
log.info('Copying Elastic license to LICENSE.txt');
|
||||
await write(build.resolvePath('LICENSE.txt'), elasticLicense);
|
||||
if (build.isOss()) {
|
||||
const ssplLicense = await read(config.resolveFromRepo('licenses/SSPL-LICENSE.txt'));
|
||||
log.info('Copying dual-license to LICENSE.txt');
|
||||
await write(
|
||||
build.resolvePath('LICENSE.txt'),
|
||||
ssplLicense + LICENSE_SEPARATOR + elasticLicense
|
||||
);
|
||||
} else {
|
||||
log.info('Copying Elastic license to LICENSE.txt');
|
||||
await write(build.resolvePath('LICENSE.txt'), elasticLicense);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
@ -73,12 +73,15 @@ export const CreateDockerUBI: Task = {
|
|||
description: 'Creating Docker UBI image',
|
||||
|
||||
async run(config, log, build) {
|
||||
await runDockerGenerator(config, log, build, {
|
||||
architecture: 'x64',
|
||||
context: false,
|
||||
ubi: true,
|
||||
image: true,
|
||||
});
|
||||
if (!build.isOss()) {
|
||||
await runDockerGenerator(config, log, build, {
|
||||
architecture: 'x64',
|
||||
context: false,
|
||||
ubi: true,
|
||||
image: true,
|
||||
dockerBuildDate,
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -92,15 +95,19 @@ export const CreateDockerContexts: Task = {
|
|||
dockerBuildDate,
|
||||
});
|
||||
|
||||
await runDockerGenerator(config, log, build, {
|
||||
ubi: true,
|
||||
context: true,
|
||||
image: false,
|
||||
});
|
||||
await runDockerGenerator(config, log, build, {
|
||||
ironbank: true,
|
||||
context: true,
|
||||
image: false,
|
||||
});
|
||||
if (!build.isOss()) {
|
||||
await runDockerGenerator(config, log, build, {
|
||||
ubi: true,
|
||||
context: true,
|
||||
image: false,
|
||||
dockerBuildDate,
|
||||
});
|
||||
await runDockerGenerator(config, log, build, {
|
||||
ironbank: true,
|
||||
context: true,
|
||||
image: false,
|
||||
dockerBuildDate,
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
|
|
|
@ -43,18 +43,24 @@ export async function runDockerGenerator(
|
|||
let imageFlavor = '';
|
||||
if (flags.ubi) imageFlavor += `-${ubiVersionTag}`;
|
||||
if (flags.ironbank) imageFlavor += '-ironbank';
|
||||
if (build.isOss()) imageFlavor += '-oss';
|
||||
|
||||
// General docker var config
|
||||
const license = 'Elastic License';
|
||||
const license = build.isOss() ? 'ASL 2.0' : 'Elastic License';
|
||||
const imageTag = 'docker.elastic.co/kibana/kibana';
|
||||
const version = config.getBuildVersion();
|
||||
const artifactArchitecture = flags.architecture === 'aarch64' ? 'aarch64' : 'x86_64';
|
||||
const artifactPrefix = `kibana-${version}-linux`;
|
||||
const artifactFlavor = build.isOss() ? '-oss' : '';
|
||||
const artifactPrefix = `kibana${artifactFlavor}-${version}-linux`;
|
||||
const artifactTarball = `${artifactPrefix}-${artifactArchitecture}.tar.gz`;
|
||||
const artifactsDir = config.resolveFromTarget('.');
|
||||
const dockerBuildDate = flags.dockerBuildDate || new Date().toISOString();
|
||||
// That would produce oss, default and default-ubi7
|
||||
const dockerBuildDir = config.resolveFromRepo('build', 'kibana-docker', `default${imageFlavor}`);
|
||||
const dockerBuildDir = config.resolveFromRepo(
|
||||
'build',
|
||||
'kibana-docker',
|
||||
build.isOss() ? `oss` : `default${imageFlavor}`
|
||||
);
|
||||
const imageArchitecture = flags.architecture === 'aarch64' ? '-aarch64' : '';
|
||||
const dockerTargetFilename = config.resolveFromTarget(
|
||||
`kibana${imageFlavor}-${version}-docker-image${imageArchitecture}.tar.gz`
|
||||
|
|
|
@ -28,7 +28,11 @@ export async function runFpm(
|
|||
const fromBuild = (...paths: string[]) => build.resolvePathForPlatform(linux, ...paths);
|
||||
|
||||
const pickLicense = () => {
|
||||
return type === 'rpm' ? 'Elastic License' : 'Elastic-License';
|
||||
if (build.isOss()) {
|
||||
return type === 'rpm' ? 'ASL 2.0' : 'ASL-2.0';
|
||||
} else {
|
||||
return type === 'rpm' ? 'Elastic License' : 'Elastic-License';
|
||||
}
|
||||
};
|
||||
|
||||
const envFolder = type === 'rpm' ? 'sysconfig' : 'default';
|
||||
|
@ -53,7 +57,7 @@ export async function runFpm(
|
|||
|
||||
// general info about the package
|
||||
'--name',
|
||||
'kibana',
|
||||
build.isOss() ? 'kibana-oss' : 'kibana',
|
||||
'--description',
|
||||
'Explore and visualize your Elasticsearch data',
|
||||
'--version',
|
||||
|
@ -67,6 +71,10 @@ export async function runFpm(
|
|||
'--license',
|
||||
pickLicense(),
|
||||
|
||||
// prevent installing kibana if installing kibana-oss and vice versa
|
||||
'--conflicts',
|
||||
build.isOss() ? 'kibana' : 'kibana-oss',
|
||||
|
||||
// define install/uninstall scripts
|
||||
'--after-install',
|
||||
resolve(__dirname, 'package_scripts/post_install.sh'),
|
||||
|
|
|
@ -33,7 +33,7 @@ node x-pack/scripts/functional_tests --assert-none-excluded \
|
|||
# Do not build kibana for code coverage run
|
||||
if [[ -z "$CODE_COVERAGE" ]] ; then
|
||||
echo " -> building and extracting default Kibana distributable for use in functional tests"
|
||||
node scripts/build --debug
|
||||
node scripts/build --debug --no-oss
|
||||
|
||||
echo " -> shipping metrics from build to ci-stats"
|
||||
node scripts/ship_ci_stats \
|
||||
|
|
|
@ -60,7 +60,7 @@ export KBN_NP_PLUGINS_BUILT=true
|
|||
|
||||
echo " -> Building and extracting default Kibana distributable for use in functional tests"
|
||||
cd "$KIBANA_DIR"
|
||||
node scripts/build --debug
|
||||
node scripts/build --debug --no-oss
|
||||
linuxBuild="$(find "$KIBANA_DIR/target" -name 'kibana-*-linux-x86_64.tar.gz')"
|
||||
installDir="$KIBANA_DIR/install/kibana"
|
||||
mkdir -p "$installDir"
|
||||
|
|
|
@ -5,7 +5,7 @@ source "$KIBANA_DIR/src/dev/ci_setup/setup_percy.sh"
|
|||
|
||||
echo " -> building and extracting default Kibana distributable"
|
||||
cd "$KIBANA_DIR"
|
||||
node scripts/build --debug
|
||||
node scripts/build --debug --no-oss
|
||||
|
||||
echo " -> shipping metrics from build to ci-stats"
|
||||
node scripts/ship_ci_stats \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue