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(
|
||||
image: string, context: string, containerFiles: string[], buildArgs: string[],
|
||||
useOCI: boolean, labels: string[], layers: string,
|
||||
extraArgs: string[], tlsVerify: boolean, arch?: string, platform?: string
|
||||
image: string,
|
||||
context: string,
|
||||
containerFiles: string[],
|
||||
buildArgs: string[],
|
||||
useOCI: boolean,
|
||||
labels: string[],
|
||||
layers: string,
|
||||
extraArgs: string[],
|
||||
tlsVerify: boolean,
|
||||
arch?: string,
|
||||
platform?: string
|
||||
): Promise<CommandResult> {
|
||||
const args: string[] = [ "bud" ];
|
||||
if (arch) {
|
||||
|
|
80
src/index.ts
80
src/index.ts
|
@ -87,8 +87,17 @@ export async function run(): Promise<void> {
|
|||
|
||||
const builtImage = [];
|
||||
if (containerFiles.length !== 0) {
|
||||
builtImage.push(...await doBuildUsingContainerFiles(cli, newImage, workspace, containerFiles, useOCI,
|
||||
archs, platforms, labelsList, buildahExtraArgs));
|
||||
builtImage.push(...await doBuildUsingContainerFiles(
|
||||
cli,
|
||||
newImage,
|
||||
workspace,
|
||||
containerFiles,
|
||||
useOCI,
|
||||
archs,
|
||||
platforms,
|
||||
labelsList,
|
||||
buildahExtraArgs
|
||||
));
|
||||
}
|
||||
else {
|
||||
if (platforms.length > 0) {
|
||||
|
@ -133,8 +142,15 @@ export async function run(): Promise<void> {
|
|||
}
|
||||
|
||||
async function doBuildUsingContainerFiles(
|
||||
cli: BuildahCli, newImage: string, workspace: string, containerFiles: string[], useOCI: boolean, archs: string[],
|
||||
platforms: string[], labels: string[], extraArgs: string[]
|
||||
cli: BuildahCli,
|
||||
newImage: string,
|
||||
workspace: string,
|
||||
containerFiles: string[],
|
||||
useOCI: boolean,
|
||||
archs: string[],
|
||||
platforms: string[],
|
||||
labels: string[],
|
||||
extraArgs: string[]
|
||||
): Promise<string[]> {
|
||||
if (containerFiles.length === 1) {
|
||||
core.info(`Performing build from Containerfile`);
|
||||
|
@ -161,8 +177,16 @@ async function doBuildUsingContainerFiles(
|
|||
tagSuffix = `-${removeIllegalCharacters(arch)}`;
|
||||
}
|
||||
await cli.buildUsingDocker(
|
||||
`${newImage}${tagSuffix}`, context, containerFileAbsPaths, buildArgs,
|
||||
useOCI, labels, layers, extraArgs, tlsVerify, arch, undefined
|
||||
`${newImage}${tagSuffix}`,
|
||||
context,
|
||||
containerFileAbsPaths,
|
||||
buildArgs,
|
||||
useOCI,
|
||||
labels,
|
||||
layers,
|
||||
extraArgs,
|
||||
tlsVerify,
|
||||
arch
|
||||
);
|
||||
builtImage.push(`${newImage}${tagSuffix}`);
|
||||
}
|
||||
|
@ -173,8 +197,17 @@ async function doBuildUsingContainerFiles(
|
|||
tagSuffix = `-${removeIllegalCharacters(platform)}`;
|
||||
}
|
||||
await cli.buildUsingDocker(
|
||||
`${newImage}${tagSuffix}`, context, containerFileAbsPaths, buildArgs,
|
||||
useOCI, labels, layers, extraArgs, tlsVerify, undefined, platform
|
||||
`${newImage}${tagSuffix}`,
|
||||
context,
|
||||
containerFileAbsPaths,
|
||||
buildArgs,
|
||||
useOCI,
|
||||
labels,
|
||||
layers,
|
||||
extraArgs,
|
||||
tlsVerify,
|
||||
undefined,
|
||||
platform
|
||||
);
|
||||
builtImage.push(`${newImage}${tagSuffix}`);
|
||||
}
|
||||
|
@ -182,15 +215,31 @@ async function doBuildUsingContainerFiles(
|
|||
|
||||
else if (archs.length === 1 || platforms.length === 1) {
|
||||
await cli.buildUsingDocker(
|
||||
newImage, context, containerFileAbsPaths, buildArgs,
|
||||
useOCI, labels, layers, extraArgs, tlsVerify, archs[0], platforms[0]
|
||||
newImage,
|
||||
context,
|
||||
containerFileAbsPaths,
|
||||
buildArgs,
|
||||
useOCI,
|
||||
labels,
|
||||
layers,
|
||||
extraArgs,
|
||||
tlsVerify,
|
||||
archs[0],
|
||||
platforms[0]
|
||||
);
|
||||
builtImage.push(newImage);
|
||||
}
|
||||
else {
|
||||
await cli.buildUsingDocker(
|
||||
newImage, context, containerFileAbsPaths, buildArgs,
|
||||
useOCI, labels, layers, extraArgs, tlsVerify
|
||||
newImage,
|
||||
context,
|
||||
containerFileAbsPaths,
|
||||
buildArgs,
|
||||
useOCI,
|
||||
labels,
|
||||
layers,
|
||||
extraArgs,
|
||||
tlsVerify
|
||||
);
|
||||
builtImage.push(newImage);
|
||||
}
|
||||
|
@ -199,7 +248,12 @@ async function doBuildUsingContainerFiles(
|
|||
}
|
||||
|
||||
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[]> {
|
||||
core.info(`Performing build from scratch`);
|
||||
|
||||
|
|
Loading…
Reference in a new issue