Resolve review comments

Signed-off-by: divyansh42 <diagrawa@redhat.com>
This commit is contained in:
divyansh42 2021-01-28 12:18:24 +05:30
parent 557824d2d1
commit 8fc3073634
9 changed files with 67 additions and 65 deletions

View file

@ -78,7 +78,7 @@ jobs:
uses: ./buildah-build/
with:
image: ${{ env.IMAGE_NAME }}
tags: 'latest v2'
tags: 'latest ${{ github.sha }}'
base-image: 'registry.access.redhat.com/openjdk/openjdk-11-rhel7'
# To avoid hardcoding a particular version of the binary.
content: |

View file

@ -34,7 +34,7 @@ After building your image, use [push-to-registry](https://github.com/redhat-acti
<td>tags</td>
<td>No</td>
<td>
The tags of the image to build. For multiple tags, seperate by a space. For example, <code>v1 v0.1</code>.<br>
The tags of the image to build. For multiple tags, seperate by a space. For example, <code>latest ${{ github.sha }}</code>.<br>
Default: <code>latest</code>
</td>
</tr>
@ -42,7 +42,7 @@ After building your image, use [push-to-registry](https://github.com/redhat-acti
<tr>
<td>base-image</td>
<td>No</td>
<td>The base image to use to create the initial container.</td>
<td>The base image to use for the container.</td>
</tr>
<tr>
@ -123,8 +123,8 @@ envs: |
`image`: The name of the built image.<br>
For example, `spring-image`.
`tags`: The list of tags delimeted by a space.<br>
For example, `v1 v0.1`.
`tags`: A list of the tags that were created, separated by spaces.<br>
For example, `latest ${{ github.sha }}`.
## Build Types

View file

@ -9,7 +9,7 @@ inputs:
description: 'The name (reference) of the image to build'
required: true
tags:
description: 'The tags of the image to build. For multiple tags, seperate by a space. For example, "v1 v0.1".'
description: 'The tags of the image to build. For multiple tags, seperate by a space. For example, "latest v1".'
required: false
default: latest
base-image:
@ -38,17 +38,17 @@ inputs:
description: 'List of environment variables to be set when running containers based on image'
required: false
build-args:
description: 'List of --build-args to pass to buildah.'
description: 'List of --build-args to pass to buildah'
required: false
oci:
description: 'Set to true to build using the OCI image format instead of the Docker image format.'
description: 'Set to true to build using the OCI image format instead of the Docker image format'
default: 'false'
required: false
outputs:
image:
description: 'Name of the image built'
tags:
description: 'List of tags delimeted by a space'
description: 'List of the tags that were created, separated by spaces'
runs:
using: 'node12'
main: 'dist/index.js'

2
dist/index.js vendored

File diff suppressed because one or more lines are too long

2
dist/index.js.map vendored

File diff suppressed because one or more lines are too long

86
package-lock.json generated
View file

@ -129,9 +129,9 @@
}
},
"@redhat-actions/eslint-config": {
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/@redhat-actions/eslint-config/-/eslint-config-1.2.4.tgz",
"integrity": "sha512-3Y+qEU2k5LBuOGmO4yY9/74GHWc3gCvFvRselFVV7Dzc43XeeicvOQSE0eoOFxTRakOY4WpXoJKh5pUOm4jOog==",
"version": "1.2.11",
"resolved": "https://registry.npmjs.org/@redhat-actions/eslint-config/-/eslint-config-1.2.11.tgz",
"integrity": "sha512-hS8XXkpWu32Z3S6+EFAvD32+QruxyLiSfqrXjkaSLtWZndkJLNZ/xpHcEwRM1u7KJzd1f7jPl46+GLFfrPT8RQ==",
"dev": true,
"requires": {
"eslint-config-airbnb-base": ">= 14",
@ -163,13 +163,13 @@
"dev": true
},
"@typescript-eslint/eslint-plugin": {
"version": "4.14.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.14.0.tgz",
"integrity": "sha512-IJ5e2W7uFNfg4qh9eHkHRUCbgZ8VKtGwD07kannJvM5t/GU8P8+24NX8gi3Hf5jST5oWPY8kyV1s/WtfiZ4+Ww==",
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-4.14.1.tgz",
"integrity": "sha512-5JriGbYhtqMS1kRcZTQxndz1lKMwwEXKbwZbkUZNnp6MJX0+OVXnG0kOlBZP4LUAxEyzu3cs+EXd/97MJXsGfw==",
"dev": true,
"requires": {
"@typescript-eslint/experimental-utils": "4.14.0",
"@typescript-eslint/scope-manager": "4.14.0",
"@typescript-eslint/experimental-utils": "4.14.1",
"@typescript-eslint/scope-manager": "4.14.1",
"debug": "^4.1.1",
"functional-red-black-tree": "^1.0.1",
"lodash": "^4.17.15",
@ -205,28 +205,28 @@
}
},
"@typescript-eslint/experimental-utils": {
"version": "4.14.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.14.0.tgz",
"integrity": "sha512-6i6eAoiPlXMKRbXzvoQD5Yn9L7k9ezzGRvzC/x1V3650rUk3c3AOjQyGYyF9BDxQQDK2ElmKOZRD0CbtdkMzQQ==",
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.14.1.tgz",
"integrity": "sha512-2CuHWOJwvpw0LofbyG5gvYjEyoJeSvVH2PnfUQSn0KQr4v8Dql2pr43ohmx4fdPQ/eVoTSFjTi/bsGEXl/zUUQ==",
"dev": true,
"requires": {
"@types/json-schema": "^7.0.3",
"@typescript-eslint/scope-manager": "4.14.0",
"@typescript-eslint/types": "4.14.0",
"@typescript-eslint/typescript-estree": "4.14.0",
"@typescript-eslint/scope-manager": "4.14.1",
"@typescript-eslint/types": "4.14.1",
"@typescript-eslint/typescript-estree": "4.14.1",
"eslint-scope": "^5.0.0",
"eslint-utils": "^2.0.0"
}
},
"@typescript-eslint/parser": {
"version": "4.14.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.14.0.tgz",
"integrity": "sha512-sUDeuCjBU+ZF3Lzw0hphTyScmDDJ5QVkyE21pRoBo8iDl7WBtVFS+WDN3blY1CH3SBt7EmYCw6wfmJjF0l/uYg==",
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-4.14.1.tgz",
"integrity": "sha512-mL3+gU18g9JPsHZuKMZ8Z0Ss9YP1S5xYZ7n68Z98GnPq02pYNQuRXL85b9GYhl6jpdvUc45Km7hAl71vybjUmw==",
"dev": true,
"requires": {
"@typescript-eslint/scope-manager": "4.14.0",
"@typescript-eslint/types": "4.14.0",
"@typescript-eslint/typescript-estree": "4.14.0",
"@typescript-eslint/scope-manager": "4.14.1",
"@typescript-eslint/types": "4.14.1",
"@typescript-eslint/typescript-estree": "4.14.1",
"debug": "^4.1.1"
},
"dependencies": {
@ -248,29 +248,29 @@
}
},
"@typescript-eslint/scope-manager": {
"version": "4.14.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.14.0.tgz",
"integrity": "sha512-/J+LlRMdbPh4RdL4hfP1eCwHN5bAhFAGOTsvE6SxsrM/47XQiPSgF5MDgLyp/i9kbZV9Lx80DW0OpPkzL+uf8Q==",
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.14.1.tgz",
"integrity": "sha512-F4bjJcSqXqHnC9JGUlnqSa3fC2YH5zTtmACS1Hk+WX/nFB0guuynVK5ev35D4XZbdKjulXBAQMyRr216kmxghw==",
"dev": true,
"requires": {
"@typescript-eslint/types": "4.14.0",
"@typescript-eslint/visitor-keys": "4.14.0"
"@typescript-eslint/types": "4.14.1",
"@typescript-eslint/visitor-keys": "4.14.1"
}
},
"@typescript-eslint/types": {
"version": "4.14.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.14.0.tgz",
"integrity": "sha512-VsQE4VvpldHrTFuVPY1ZnHn/Txw6cZGjL48e+iBxTi2ksa9DmebKjAeFmTVAYoSkTk7gjA7UqJ7pIsyifTsI4A==",
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.14.1.tgz",
"integrity": "sha512-SkhzHdI/AllAgQSxXM89XwS1Tkic7csPdndUuTKabEwRcEfR8uQ/iPA3Dgio1rqsV3jtqZhY0QQni8rLswJM2w==",
"dev": true
},
"@typescript-eslint/typescript-estree": {
"version": "4.14.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.14.0.tgz",
"integrity": "sha512-wRjZ5qLao+bvS2F7pX4qi2oLcOONIB+ru8RGBieDptq/SudYwshveORwCVU4/yMAd4GK7Fsf8Uq1tjV838erag==",
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.14.1.tgz",
"integrity": "sha512-M8+7MbzKC1PvJIA8kR2sSBnex8bsR5auatLCnVlNTJczmJgqRn8M+sAlQfkEq7M4IY3WmaNJ+LJjPVRrREVSHQ==",
"dev": true,
"requires": {
"@typescript-eslint/types": "4.14.0",
"@typescript-eslint/visitor-keys": "4.14.0",
"@typescript-eslint/types": "4.14.1",
"@typescript-eslint/visitor-keys": "4.14.1",
"debug": "^4.1.1",
"globby": "^11.0.1",
"is-glob": "^4.0.1",
@ -306,12 +306,12 @@
}
},
"@typescript-eslint/visitor-keys": {
"version": "4.14.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.14.0.tgz",
"integrity": "sha512-MeHHzUyRI50DuiPgV9+LxcM52FCJFYjJiWHtXlbyC27b80mfOwKeiKI+MHOTEpcpfmoPFm/vvQS88bYIx6PZTA==",
"version": "4.14.1",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.14.1.tgz",
"integrity": "sha512-TAblbDXOI7bd0C/9PE1G+AFo7R5uc+ty1ArDoxmrC1ah61Hn6shURKy7gLdRb1qKJmjHkqu5Oq+e4Kt0jwf1IA==",
"dev": true,
"requires": {
"@typescript-eslint/types": "4.14.0",
"@typescript-eslint/types": "4.14.1",
"eslint-visitor-keys": "^2.0.0"
}
},
@ -1000,9 +1000,9 @@
"dev": true
},
"get-intrinsic": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.2.tgz",
"integrity": "sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg==",
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.0.tgz",
"integrity": "sha512-M11rgtQp5GZMZzDL7jLTNxbDfurpzuau5uqRWDPvlHjfvg3TdScAZo96GLvhMjImrmR8uAt0FS2RLoMrfWGKlg==",
"dev": true,
"requires": {
"function-bind": "^1.1.1",
@ -1855,9 +1855,9 @@
"dev": true
},
"tsutils": {
"version": "3.19.1",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.19.1.tgz",
"integrity": "sha512-GEdoBf5XI324lu7ycad7s6laADfnAqCw6wLGI+knxvw9vsIYBaJfYdmeCEG3FMMUiSm3OGgNb+m6utsWf5h9Vw==",
"version": "3.20.0",
"resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.20.0.tgz",
"integrity": "sha512-RYbuQuvkhuqVeXweWT3tJLKOEJ/UUw9GjNEZGWdrLLlM+611o1gwLHBpxoFJKKl25fLprp2eVthtKs5JOrNeXg==",
"dev": true,
"requires": {
"tslib": "^1.8.1"

View file

@ -26,11 +26,11 @@
"language-recognizer": "0.0.1"
},
"devDependencies": {
"@redhat-actions/eslint-config": "^1.2.4",
"@redhat-actions/eslint-config": "^1.2.11",
"@redhat-actions/tsconfig": "^1.1.1",
"@types/node": "^12",
"@typescript-eslint/eslint-plugin": "^4.14.0",
"@typescript-eslint/parser": "^4.14.0",
"@typescript-eslint/eslint-plugin": "^4.14.1",
"@typescript-eslint/parser": "^4.14.1",
"@vercel/ncc": "^0.25.1",
"eslint": "^7.18.0",
"typescript": "^4.0.5"

View file

@ -98,8 +98,10 @@ export class BuildahCli implements Buildah {
core.debug("commit");
core.debug(container);
core.debug(newImageName);
const args: string[] = [ "commit", ...BuildahCli.getImageFormatOption(useOCI),
"--squash", container, newImageName ];
const args: string[] = [
"commit", ...BuildahCli.getImageFormatOption(useOCI),
"--squash", container, newImageName,
];
return this.execute(args);
}
@ -130,10 +132,10 @@ export class BuildahCli implements Buildah {
finalExecOptions.ignoreReturnCode = true; // the return code is processed below
finalExecOptions.listeners = {
stdline: (line) : void => {
stdline: (line): void => {
stdout += line + "\n";
},
errline: (line) :void => {
errline: (line):void => {
stderr += line + "\n";
},
};

View file

@ -12,10 +12,10 @@ export async function run(): Promise<void> {
const buildahPath = await io.which("buildah", true);
const cli: BuildahCli = new BuildahCli(buildahPath);
const workspace = process.env.GITHUB_WORKSPACE || "";
const workspace = process.env.GITHUB_WORKSPACE || process.cwd();
const dockerFiles = getInputList("dockerfiles");
const image = core.getInput("image", { required: true });
const tags = core.getInput("tags");
const tags = core.getInput("tags") || "latest";
const tagsList: string[] = tags.split(" ");
const newImage = `${image}:${tagsList[0]}`;
const useOCI = core.getInput("oci") === "true";
@ -46,8 +46,8 @@ async function doBuildUsingDockerFiles(
const context = path.join(workspace, core.getInput("context"));
const buildArgs = getInputList("build-args");
const inputdockerFiles = dockerFiles.map((file) => path.join(workspace, file));
await cli.buildUsingDocker(newImage, context, inputdockerFiles, buildArgs, useOCI);
const dockerFileAbsPaths = dockerFiles.map((file) => path.join(workspace, file));
await cli.buildUsingDocker(newImage, context, dockerFileAbsPaths, buildArgs, useOCI);
}
async function doBuildFromScratch(