mirror of
https://github.com/redhat-actions/buildah-build.git
synced 2025-04-20 09:01:23 +00:00
fix: eslint issues
This commit is contained in:
parent
4966a271fb
commit
4ba7f65c03
4 changed files with 80 additions and 18 deletions
2
dist/index.js
vendored
2
dist/index.js
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
vendored
2
dist/index.js.map
vendored
File diff suppressed because one or more lines are too long
|
@ -66,9 +66,17 @@ export class BuildahCli implements Buildah {
|
||||||
}
|
}
|
||||||
|
|
||||||
async buildUsingDocker(
|
async buildUsingDocker(
|
||||||
image: string, context: string, containerFiles: string[], buildArgs: string[],
|
image: string,
|
||||||
useOCI: boolean, labels: string[], layers: string,
|
context: string,
|
||||||
extraArgs: string[], tlsVerify: boolean, arch?: string, platform?: string
|
containerFiles: string[],
|
||||||
|
buildArgs: string[],
|
||||||
|
useOCI: boolean,
|
||||||
|
labels: string[],
|
||||||
|
layers: string,
|
||||||
|
extraArgs: string[],
|
||||||
|
tlsVerify: boolean,
|
||||||
|
arch?: string,
|
||||||
|
platform?: string
|
||||||
): Promise<CommandResult> {
|
): Promise<CommandResult> {
|
||||||
const args: string[] = [ "bud" ];
|
const args: string[] = [ "bud" ];
|
||||||
if (arch) {
|
if (arch) {
|
||||||
|
|
80
src/index.ts
80
src/index.ts
|
@ -87,8 +87,17 @@ export async function run(): Promise<void> {
|
||||||
|
|
||||||
const builtImage = [];
|
const builtImage = [];
|
||||||
if (containerFiles.length !== 0) {
|
if (containerFiles.length !== 0) {
|
||||||
builtImage.push(...await doBuildUsingContainerFiles(cli, newImage, workspace, containerFiles, useOCI,
|
builtImage.push(...await doBuildUsingContainerFiles(
|
||||||
archs, platforms, labelsList, buildahExtraArgs));
|
cli,
|
||||||
|
newImage,
|
||||||
|
workspace,
|
||||||
|
containerFiles,
|
||||||
|
useOCI,
|
||||||
|
archs,
|
||||||
|
platforms,
|
||||||
|
labelsList,
|
||||||
|
buildahExtraArgs
|
||||||
|
));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (platforms.length > 0) {
|
if (platforms.length > 0) {
|
||||||
|
@ -133,8 +142,15 @@ export async function run(): Promise<void> {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function doBuildUsingContainerFiles(
|
async function doBuildUsingContainerFiles(
|
||||||
cli: BuildahCli, newImage: string, workspace: string, containerFiles: string[], useOCI: boolean, archs: string[],
|
cli: BuildahCli,
|
||||||
platforms: string[], labels: string[], extraArgs: string[]
|
newImage: string,
|
||||||
|
workspace: string,
|
||||||
|
containerFiles: string[],
|
||||||
|
useOCI: boolean,
|
||||||
|
archs: string[],
|
||||||
|
platforms: string[],
|
||||||
|
labels: string[],
|
||||||
|
extraArgs: string[]
|
||||||
): Promise<string[]> {
|
): Promise<string[]> {
|
||||||
if (containerFiles.length === 1) {
|
if (containerFiles.length === 1) {
|
||||||
core.info(`Performing build from Containerfile`);
|
core.info(`Performing build from Containerfile`);
|
||||||
|
@ -161,8 +177,16 @@ async function doBuildUsingContainerFiles(
|
||||||
tagSuffix = `-${removeIllegalCharacters(arch)}`;
|
tagSuffix = `-${removeIllegalCharacters(arch)}`;
|
||||||
}
|
}
|
||||||
await cli.buildUsingDocker(
|
await cli.buildUsingDocker(
|
||||||
`${newImage}${tagSuffix}`, context, containerFileAbsPaths, buildArgs,
|
`${newImage}${tagSuffix}`,
|
||||||
useOCI, labels, layers, extraArgs, tlsVerify, arch, undefined
|
context,
|
||||||
|
containerFileAbsPaths,
|
||||||
|
buildArgs,
|
||||||
|
useOCI,
|
||||||
|
labels,
|
||||||
|
layers,
|
||||||
|
extraArgs,
|
||||||
|
tlsVerify,
|
||||||
|
arch
|
||||||
);
|
);
|
||||||
builtImage.push(`${newImage}${tagSuffix}`);
|
builtImage.push(`${newImage}${tagSuffix}`);
|
||||||
}
|
}
|
||||||
|
@ -173,8 +197,17 @@ async function doBuildUsingContainerFiles(
|
||||||
tagSuffix = `-${removeIllegalCharacters(platform)}`;
|
tagSuffix = `-${removeIllegalCharacters(platform)}`;
|
||||||
}
|
}
|
||||||
await cli.buildUsingDocker(
|
await cli.buildUsingDocker(
|
||||||
`${newImage}${tagSuffix}`, context, containerFileAbsPaths, buildArgs,
|
`${newImage}${tagSuffix}`,
|
||||||
useOCI, labels, layers, extraArgs, tlsVerify, undefined, platform
|
context,
|
||||||
|
containerFileAbsPaths,
|
||||||
|
buildArgs,
|
||||||
|
useOCI,
|
||||||
|
labels,
|
||||||
|
layers,
|
||||||
|
extraArgs,
|
||||||
|
tlsVerify,
|
||||||
|
undefined,
|
||||||
|
platform
|
||||||
);
|
);
|
||||||
builtImage.push(`${newImage}${tagSuffix}`);
|
builtImage.push(`${newImage}${tagSuffix}`);
|
||||||
}
|
}
|
||||||
|
@ -182,15 +215,31 @@ async function doBuildUsingContainerFiles(
|
||||||
|
|
||||||
else if (archs.length === 1 || platforms.length === 1) {
|
else if (archs.length === 1 || platforms.length === 1) {
|
||||||
await cli.buildUsingDocker(
|
await cli.buildUsingDocker(
|
||||||
newImage, context, containerFileAbsPaths, buildArgs,
|
newImage,
|
||||||
useOCI, labels, layers, extraArgs, tlsVerify, archs[0], platforms[0]
|
context,
|
||||||
|
containerFileAbsPaths,
|
||||||
|
buildArgs,
|
||||||
|
useOCI,
|
||||||
|
labels,
|
||||||
|
layers,
|
||||||
|
extraArgs,
|
||||||
|
tlsVerify,
|
||||||
|
archs[0],
|
||||||
|
platforms[0]
|
||||||
);
|
);
|
||||||
builtImage.push(newImage);
|
builtImage.push(newImage);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
await cli.buildUsingDocker(
|
await cli.buildUsingDocker(
|
||||||
newImage, context, containerFileAbsPaths, buildArgs,
|
newImage,
|
||||||
useOCI, labels, layers, extraArgs, tlsVerify
|
context,
|
||||||
|
containerFileAbsPaths,
|
||||||
|
buildArgs,
|
||||||
|
useOCI,
|
||||||
|
labels,
|
||||||
|
layers,
|
||||||
|
extraArgs,
|
||||||
|
tlsVerify
|
||||||
);
|
);
|
||||||
builtImage.push(newImage);
|
builtImage.push(newImage);
|
||||||
}
|
}
|
||||||
|
@ -199,7 +248,12 @@ async function doBuildUsingContainerFiles(
|
||||||
}
|
}
|
||||||
|
|
||||||
async function doBuildFromScratch(
|
async function doBuildFromScratch(
|
||||||
cli: BuildahCli, newImage: string, useOCI: boolean, archs: string[], labels: string[], extraArgs: string[]
|
cli: BuildahCli,
|
||||||
|
newImage: string,
|
||||||
|
useOCI: boolean,
|
||||||
|
archs: string[],
|
||||||
|
labels: string[],
|
||||||
|
extraArgs: string[]
|
||||||
): Promise<string[]> {
|
): Promise<string[]> {
|
||||||
core.info(`Performing build from scratch`);
|
core.info(`Performing build from scratch`);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue