Skip to content

Commit

Permalink
Simplify, require projects to use container directly.
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenj committed Jan 13, 2023
1 parent 1ae0879 commit 333768e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 90 deletions.
14 changes: 0 additions & 14 deletions Dockerfile

This file was deleted.

61 changes: 12 additions & 49 deletions README.md
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

Expand All @@ -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
Expand All @@ -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.
22 changes: 0 additions & 22 deletions action.yml

This file was deleted.

16 changes: 11 additions & 5 deletions tools_container/Dockerfile
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
Expand Down Expand Up @@ -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.

0 comments on commit 333768e

Please sign in to comment.