Skip to content

Commit

Permalink
Resolve review comments
Browse files Browse the repository at this point in the history
Signed-off-by: divyansh42 <[email protected]>
  • Loading branch information
divyansh42 committed Jan 28, 2021
1 parent 557824d commit 7621fec
Show file tree
Hide file tree
Showing 9 changed files with 67 additions and 65 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/verify-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ 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>

<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>
Expand Down Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ${{ github.sha }}".'
required: false
default: latest
base-image:
Expand Down Expand Up @@ -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 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

86 changes: 43 additions & 43 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 6 additions & 4 deletions src/buildah.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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";
},
};
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 7621fec

Please sign in to comment.