Skip to content

Commit

Permalink
docs: update README
Browse files Browse the repository at this point in the history
Signed-off-by: Vasek - Tom C <[email protected]>
  • Loading branch information
TomChv committed Jan 23, 2024
1 parent 433a188 commit 9413457
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .dagger/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Agate CI

Agate use [Dagger](https://dagger.io/) to handle its CI and local development.

## Table of Contents

- [Requirements](#requirements)
- [Dagger commands](#dagger-commands)
- [Open a shell inside a container with the project loaded](#open-a-shell-inside-a-container-with-the-project-loaded)
- [Install Agate binary from local source](#install-agate-binary-from-local-source)
- [Start a PostgreSQL database](#start-a-postgresql-database)
- [Execute CI locally](#execute-ci-locally)

## Requirements

- [Dagger CLI installed in your host](https://docs.dagger.io/cli/465058/install)

## Dagger commands

💡 You can list all functions using `dagger functions`

### Open a shell inside a container with the project loaded

```shell
dagger shell project --entrypoint /bin/sh
```

Use it to debug flacky tests or test things inside the CI or container environment.

### Install Agate binary from local source

```shell
dagger export binary
```

You should see `agate` binary in your current host directory.

### Start a PostgreSQL database

```shell
dagger up --native database
```

You can either configure the database with flags in the CLI or using your environment.

💡 Execute `dagger call database --help` to see the flags.

### Execute CI locally

```shell
dagger call ci run
```

This will build, lint and run unit tests in parallel.

💡 Execute `dagger call ci --help` to see additional subcommands.
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,11 @@ To build Agate using Docker, run the following command:
docker build -t agate .
```

To build Agate using [Dagger](https://dagger.io/), run the following command:
```
dagger -m ./.dagger export binary
```

### Start the project

#### Using the binary built from source
Expand Down Expand Up @@ -115,6 +120,10 @@ To run both agate and postgres using Docker, run the following command:
docker compose up # optional: -d to run the containers in detached moe.
```

### Test the project

Check out [the dedicated file](.dagger/README.md)

## Contributing

Check out [the dedicated file](./CONTRIBUTING.md)!
Expand Down

0 comments on commit 9413457

Please sign in to comment.