Add extra-args input for build using dockerfile (#53)

Signed-off-by: divyansh42 <diagrawa@redhat.com>
This commit is contained in:
Divyanshu Agrawal 2021-04-12 22:43:19 +05:30 committed by GitHub
parent b78bde0b60
commit 2f7f68ec84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 59 additions and 5 deletions

View file

@ -1,3 +1,8 @@
/***************************************************************************************************
* Copyright (c) Red Hat, Inc. All rights reserved.
* Licensed under the MIT License. See LICENSE file in the project root for license information.
**************************************************************************************************/
import * as core from "@actions/core";
import * as exec from "@actions/exec";
import * as path from "path";
@ -15,7 +20,7 @@ export interface BuildahConfigSettings {
interface Buildah {
buildUsingDocker(
image: string, context: string, dockerFiles: string[], buildArgs: string[],
useOCI: boolean, archs: string, layers: string
useOCI: boolean, archs: string, layers: string, extraArgs: string[]
): Promise<CommandResult>;
from(baseImage: string): Promise<CommandResult>;
copy(container: string, contentToCopy: string[]): Promise<CommandResult | undefined>;
@ -58,7 +63,7 @@ export class BuildahCli implements Buildah {
async buildUsingDocker(
image: string, context: string, dockerFiles: string[], buildArgs: string[],
useOCI: boolean, archs: string, layers: string
useOCI: boolean, archs: string, layers: string, extraArgs: string[]
): Promise<CommandResult> {
const args: string[] = [ "bud" ];
if (archs) {
@ -77,6 +82,9 @@ export class BuildahCli implements Buildah {
if (layers) {
args.push(`--layers=${layers}`);
}
if (extraArgs.length > 0) {
args.push(...extraArgs);
}
args.push("-t");
args.push(image);
args.push(context);