Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add docker container to generate parsers and languages #154

Merged
merged 7 commits into from
Aug 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 24 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,46 @@ localisations and generating the parser is done separately from building each pr

## Generating parsers

Prerequisites:
*Either* start a docker container

```shell
docker build --tag berp-env .
docker run --rm --interactive --tty --volume ".:/app" berp-env
```

*Or* install on your system

* .NET 5.0 (to run `berp` to generate parsers)
* `berp` (install with `dotnet tool update Berp --version 1.3.0 --tool-path /usr/bin` )
* `make`
* `jq` (>= 1.4 for `--sort-keys` option)
* `diff`
* `git`

With all this installed use Make:
With either of these done run:

```
make generate
```shell
make clean-generate
make generate
```

## Adding or updating an i18n language

Prerequisites:
1) Edit `gherkin-langauges.json`.

* `make`
* `jq` (>= 1.4 for `--sort-keys` option)
* `git`
2) Distribute the changes to the different parser implementations:

1) Edit `gherkin-langauges.json`.
*Either* start a docker container. See [Generating Parsers](#generating-parsers)

2) Distribute the changes to the different parser implementations, this requires `make`, `jq`, `diff`, but no compiler/interpreters:
*Or* install on your system

```
make clean-gherkin-languages
make copy-gherkin-languages
```
* `make`
* `jq` (>= 1.4 for `--sort-keys` option)

Then with either of these done run

```shell
make clean-gherkin-languages
make copy-gherkin-languages
```

3) Make a pull request with the changed files.

Expand Down
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Builds a docker image used for building most projects in this repo. It's
# used both by contributors and CI.
#
FROM mcr.microsoft.com/dotnet/sdk:6.0

ENV DEBIAN_FRONTEND=noninteractive

RUN apt-get update \
&& apt-get install --assume-yes \
make \
jq


WORKDIR /app

## Trigger first run experience by running arbitrary cmd to populate local package cache
RUN dotnet --list-sdks

# Install Berp (dotnet tool installs are user-global; not system global)
RUN dotnet tool install --global Berp --version 1.4.0 \
&& echo 'export PATH="$PATH:/root/.dotnet/tools"' >> ~/.bashrc

WORKDIR /app

CMD ["/bin/bash"]