-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify, require projects to use container directly.
- Loading branch information
Showing
5 changed files
with
23 additions
and
90 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Project Catalyst Github Action for supplying Rust and related tools to speed up CI builds | ||
# Project Catalyst Tools Container for supplying Rust and related tools to speed up CI builds | ||
|
||
Custom GH Action to speed up and simplify building in CI that requires tools to be built during the CI process. | ||
Container to speed up and simplify building in CI that requires tools to be built during the CI process. | ||
|
||
## Tools Provided | ||
|
||
|
@@ -15,45 +15,20 @@ Custom GH Action to speed up and simplify building in CI that requires tools to | |
* mdbook-regex | ||
* mdbook-admonish | ||
|
||
## Inputs | ||
|
||
## `tool-cmd` | ||
|
||
**Required** when `entrypoint` not customized. | ||
|
||
This command is run verbatim, inside the container, at the root of the checked-out repository along with any arguments following it. | ||
|
||
If the `entrypoint` is modified, this only contains the arguments to that `entrypoint` and is not required. | ||
|
||
## `entrypoint` | ||
|
||
**Optional** Over-ride the default entry point. | ||
|
||
## Outputs | ||
|
||
None, other than build artefacts from the executed command. | ||
|
||
## Example usage | ||
|
||
### Build mdbook docs and fail on linkcheck | ||
|
||
NOTE: *Requires the cargo make command of the project to have a 'build-docs-linkcheck' rule* | ||
|
||
```yaml | ||
uses: input-output-hk/[email protected] | ||
with: | ||
tool-cmd: cargo make build-docs-linkcheck | ||
``` | ||
### Use a custom entry point from the repo | ||
NOTE: *Requires the repo to have the 'my_entrypoint.sh' in its root.* | ||
```yaml | ||
uses: input-output-hk/[email protected] | ||
with: | ||
entrypoint: './my_entrypoint.sh' | ||
tool-cmd: parameters to my entrypoint would go here | ||
runs: | ||
using: 'docker' | ||
image: 'input-output-hk/catalyst-standards:v0.8' | ||
entrypoint: 'cargo' | ||
args: | ||
- 'make' | ||
- 'build-docs-linkcheck' | ||
``` | ||
## How it works | ||
|
@@ -68,20 +43,8 @@ This container is automatically built by github CI using `.github/workflows/buil | |
* Image is called `input-output-hk/catalyst-standards:v??` | ||
* Latest Image is updated in `input-output-hk/catalyst-standards:latest` | ||
|
||
The `./Dockerfile` is then used by the action when run by the consuming CI. It creates a NEW temporary container and customizes that container's entry point. | ||
|
||
### Optional usage | ||
The `./Dockerfile` is then used by CI to quickly provide all the tools we might need. | ||
|
||
Instead of using this GitHub action, the 'input-output-hk/catalyst-standards` tools container can be used directly in CI. | ||
### Recommendation | ||
|
||
Example: | ||
|
||
```yaml | ||
runs: | ||
using: 'docker' | ||
image: 'input-output-hk/catalyst-standards:v0.5' | ||
args: | ||
- 'bzz' | ||
pre-entrypoint: 'setup.sh' | ||
entrypoint: 'main.sh' | ||
``` | ||
The specific version of the container should always be specified so that updates do not break builds unexpectedly. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Container image that runs your code | ||
FROM rust:1.66.1-slim AS build | ||
FROM rust:1.66.1-slim | ||
|
||
LABEL maintainer="[email protected]" | ||
ENV RUST_LOG info | ||
|
@@ -43,8 +43,14 @@ RUN cargo install mdbook-open-on-gh --vers ${MDBOOK_OPEN_ON_GH_VERSION} --verbos | |
RUN cargo install mdbook-regex --vers ${MDBOOK_REGEX_VERSION} --verbose | ||
RUN cargo install mdbook-admonish --vers ${MDBOOK_ADMONISH_VERSION} --verbose | ||
|
||
LABEL maintainer="[email protected]" | ||
ENV RUST_LOG info | ||
|
||
# used when serving | ||
EXPOSE 3000 | ||
|
||
# Copies your code file from your action repository to the filesystem path `/` of the container | ||
COPY entrypoint.sh /entrypoint.sh | ||
|
||
# Nominally this is an `mdbook` Tool container, but we have everything | ||
# the Rust 1.66.1 docker container has available as well any other tools we | ||
# install. | ||
ENTRYPOINT [ "/bin/mdbook" ] | ||
# Code file to execute when the docker container starts up (`entrypoint.sh`) | ||
ENTRYPOINT ["/entrypoint.sh"] |
File renamed without changes.