mirror of
https://github.com/redhat-actions/buildah-build.git
synced 2025-06-08 10:01:34 +00:00
Update Action to Node 16 and handle set-output deprecation (#109)
* update: action runtime to node16 * chore: pin dependencies * fix: build error with new TS version * add: editorconfig * chore: update all actions used in workflows * update: readme action sample versions * chore: bump developer dependencies * chore: bump developer dependencies * fix: eslint issues * fix: broken buildah copy logic * chore: address review feedback version bump
This commit is contained in:
parent
4b8d36793b
commit
5177407148
20 changed files with 3587 additions and 4880 deletions
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…
Add table
Add a link
Reference in a new issue