-
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.
* Switch from `make` to `just`. It's a simpler format. See the docs for all the reasons why I prefer it: https://github.com/casey/just#what-are-the-idiosyncrasies-of-make-that-just-avoids Also adds some improvements to the Nix setup that I discovered when actually trying to run these commands. * Lowercase "justfile".
- Loading branch information
1 parent
1908d38
commit 6ebf955
Showing
6 changed files
with
70 additions
and
58 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
source_env_if_exists .envrc.local |
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,11 +1,13 @@ | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
# Rust | ||
## will have compiled files and executables | ||
debug/ | ||
target/ | ||
|
||
# These are backup files generated by rustfmt | ||
## These are backup files generated by rustfmt | ||
**/*.rs.bk | ||
|
||
# MSVC Windows builds of rustc generate these, which store debugging information | ||
## MSVC Windows builds of rustc generate these, which store debugging information | ||
*.pdb | ||
*.swp | ||
|
||
# direnv | ||
/.direnv | ||
.envrc.local |
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
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 |
---|---|---|
@@ -0,0 +1,41 @@ | ||
POSTGRESQL_CONNECTION_STRING := "postgresql://postgres:password@localhost:64002" | ||
|
||
# we use this port because it's hardcoded in the metadata too | ||
POSTGRES_DC_PORT := "8666" | ||
|
||
# watch the code and re-run on changes | ||
dev: | ||
RUST_LOG=DEBUG \ | ||
PORT={{POSTGRES_DC_PORT}} \ | ||
POSTGRESQL_CONNECTION_STRING={{POSTGRESQL_CONNECTION_STRING}} \ | ||
cargo watch -c -x test -x run | ||
|
||
# run postgres + jaeger | ||
start-docker: | ||
# start jaeger, configured to listen to V3 | ||
docker compose -f ../v3-experiments/crates/engine/services/dev.docker-compose.yaml up -d jaeger | ||
# start our local postgres | ||
docker compose up --wait | ||
|
||
run-v3: start-docker | ||
@echo "http://localhost:3000/ for graphiql console" | ||
@echo "http://localhost:4002/ for jaeger console" | ||
# Run graphql-engine using static Chinook metadata | ||
# we expect the `v3-experiments` repo to live next door to this one | ||
RUST_LOG=DEBUG cargo run --release \ | ||
--manifest-path ../v3-experiments/Cargo.toml --bin engine -- \ | ||
--metadata-path ./static/metadata-example.json \ | ||
--data-connectors-config ./static/data-connectors-config-example.json \ | ||
--secrets-path ./static/secrets-example.json | ||
|
||
# run-postgres-dc, pointing it at local postgres etc | ||
run-postgres-dc: start-docker | ||
RUST_LOG=DEBUG \ | ||
PORT={{POSTGRES_DC_PORT}} \ | ||
POSTGRESQL_CONNECTION_STRING={{POSTGRESQL_CONNECTION_STRING}} \ | ||
cargo run --release | ||
|
||
# start a postgres docker image and connect to it using psql | ||
repl-postgres: | ||
@docker compose up --wait postgres | ||
psql {{POSTGRESQL_CONNECTION_STRING}} |
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 |
---|---|---|
|
@@ -5,13 +5,16 @@ | |
### Prequisites | ||
|
||
1. Install [rustup](https://www.rust-lang.org/tools/install). | ||
2. Install additional tools: `cargo install watch rustfmt`, `rustup component add rust-analyzer`. | ||
3. Install [docker](https://www.docker.com/) | ||
4. Install protoc. Here are a few options: | ||
- `brew install protobuf` | ||
- `apt-get install protobuf-compiler` | ||
- `dnf install protobuf-compiler` | ||
5. Clone v3 experiments in a directory near this one: `(cd .. && git clone [email protected]:hasura/v3-experiments.git)` | ||
2. Install additional tools: | ||
- `cargo install watch rustfmt` | ||
- `rustup component add rust-analyzer` | ||
3. Install [just](https://github.com/casey/just) | ||
4. Install [docker](https://www.docker.com/) | ||
5. Install protoc. Here are a few options: | ||
- `brew install protobuf` | ||
- `apt-get install protobuf-compiler` | ||
- `dnf install protobuf-compiler` | ||
6. Clone v3 experiments in a directory near this one: `(cd .. && git clone [email protected]:hasura/v3-experiments.git)` | ||
|
||
### Compile | ||
|
||
|