mirror of
https://github.com/redhat-actions/buildah-build.git
synced 2025-04-20 09:01:23 +00:00
readme + cleaning
Signed-off-by: Luca Stocchi <lstocchi@redhat.com>
This commit is contained in:
parent
2168b4e067
commit
1196e988b8
4 changed files with 98 additions and 7 deletions
93
README.md
93
README.md
|
@ -1,4 +1,4 @@
|
||||||
# buildah
|
# buildah-action
|
||||||
|
|
||||||
Buildah is a GitHub Action for building OCI-compatible (Docker- and Kubernetes-compatible) images quickly and easily.
|
Buildah is a GitHub Action for building OCI-compatible (Docker- and Kubernetes-compatible) images quickly and easily.
|
||||||
|
|
||||||
|
@ -6,3 +6,94 @@ Buildah action works only on Linux distributions, and it is not supported on Win
|
||||||
|
|
||||||
Note that GitHub's [Ubuntu Environments](https://github.com/actions/virtual-environments#available-environments) (ubuntu-20.04 and ubuntu-18.04) come with buildah 1.17.0 installed. So, if you are not using those Ubuntu environments you need to make sure to install buildah tool in an early step.
|
Note that GitHub's [Ubuntu Environments](https://github.com/actions/virtual-environments#available-environments) (ubuntu-20.04 and ubuntu-18.04) come with buildah 1.17.0 installed. So, if you are not using those Ubuntu environments you need to make sure to install buildah tool in an early step.
|
||||||
|
|
||||||
|
## Action Inputs
|
||||||
|
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Action input</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>new-image-name</td>
|
||||||
|
<td>(Required) Name to give to the image that will be eventually created.</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>base-name</td>
|
||||||
|
<td>(Optional) The base image to use to create the initial container. If not specified, the action will try to pick one automatically. Only Java language is supported at this time.</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>content</td>
|
||||||
|
<td>(Required) The content to copy inside the container to create the final image. This is a multiline input to allow you to copy more than one file/directory. For example - <br> content: | <br> target/spring-petclinic-2.3.0.BUILD-SNAPSHOT.jar</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>entrypoint</td>
|
||||||
|
<td>(Required) The entry point to set for the container. This is a multiline input to add multiple values. For example - <br> entrypoint: | <br> java <br> -jar <br> spring-petclinic-2.3.0.BUILD-SNAPSHOT.jar</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>port</td>
|
||||||
|
<td>(Required) The port to expose when running the container.</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>working-dir</td>
|
||||||
|
<td>(Optional) The working directory to use within the container.</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td>envs</td>
|
||||||
|
<td>(Optional) The environment variables to be set when running the container. This is a multiline input to add multiple environment variables.For example - <br> envs: | <br> GOPATH=/root/buildah</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
## Examples
|
||||||
|
|
||||||
|
```
|
||||||
|
name: CI
|
||||||
|
on: [push]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build image
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Maven
|
||||||
|
run: |
|
||||||
|
cd ${GITHUB_WORKSPACE}
|
||||||
|
mvn package
|
||||||
|
- name: Build Action
|
||||||
|
uses: redhat-actions/buildah-action@0.0.1
|
||||||
|
with:
|
||||||
|
new-image-name: petclinic
|
||||||
|
content: |
|
||||||
|
target/spring-petclinic-2.3.0.BUILD-SNAPSHOT.jar
|
||||||
|
entrypoint: |
|
||||||
|
java
|
||||||
|
-jar
|
||||||
|
spring-petclinic-2.3.0.BUILD-SNAPSHOT.jar
|
||||||
|
port: 8080
|
||||||
|
```
|
||||||
|
|
||||||
|
## Contributing
|
||||||
|
|
||||||
|
This is an open source project open to anyone. This project welcomes contributions and suggestions!
|
||||||
|
|
||||||
|
## Feedback & Questions
|
||||||
|
|
||||||
|
If you discover an issue please file a bug in [GitHub issues](https://github.com/redhat-actions/buildah/issues) and we will fix it as soon as possible.
|
||||||
|
|
||||||
|
## License
|
||||||
|
|
||||||
|
MIT, See [LICENSE](https://github.com/redhat-actions/buildah/blob/main/LICENSE.md) for more information.
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
name: 'Lucas Test Build Action'
|
name: 'Buildah Action'
|
||||||
description: 'This action allows you to build an image from your app'
|
description: 'This action allows you to build an image from your app'
|
||||||
author: 'Luca'
|
author: 'Red Hat'
|
||||||
branding:
|
branding:
|
||||||
icon: circle
|
icon: circle
|
||||||
color: red
|
color: red
|
||||||
|
@ -19,7 +19,7 @@ inputs:
|
||||||
required: true
|
required: true
|
||||||
port:
|
port:
|
||||||
description: 'Port'
|
description: 'Port'
|
||||||
required: false
|
required: true
|
||||||
working-dir:
|
working-dir:
|
||||||
description: 'Working directory'
|
description: 'Working directory'
|
||||||
required: false
|
required: false
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "buildah-action",
|
"name": "buildah-action",
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"description": "",
|
"description": "Action for building OCI-compatible images using buildah",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"compile": "tsc -p .",
|
"compile": "tsc -p .",
|
||||||
|
|
|
@ -103,8 +103,8 @@ export class BuildahCli implements Buildah {
|
||||||
};
|
};
|
||||||
const exitCode = await exec.exec(this.executable, args, options);
|
const exitCode = await exec.exec(this.executable, args, options);
|
||||||
if (exitCode === 1) {
|
if (exitCode === 1) {
|
||||||
return Promise.resolve({ succeeded: false, error: error });
|
return Promise.resolve({ succeeded: false, error });
|
||||||
}
|
}
|
||||||
return Promise.resolve({ succeeded: true, output: output });
|
return Promise.resolve({ succeeded: true, output });
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue