-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathjustfile
82 lines (63 loc) · 2.18 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
set shell := ["nu", "-c"]
kvsd_user := "synduser"
github_pat := env_var_or_default("GH_PAT", "")
otlp_endpoint := env_var_or_default("OTEL_EXPORTER_OTLP_ENDPOINT", "")
loki_endpoint := env_var_or_default("LOKI_ENDPOINT","")
alias format := fmt
# List recipe
default:
just --list
# Run check
check:
nix flake check --all-systems
# Format files
fmt: fmt-toml
lint:
cargo clippy
# Format toml files
fmt-toml:
taplo fmt --config taplo.toml **.toml
test:
cargo nextest run
# Run integration test
integration:
RUST_LOG="synd_term,integration=debug" cargo nextest run --package synd_term --features integration --test integration --no-capture
update-gql-schema:
@graphql-client introspect-schema http://localhost:5959/graphql \
--header 'authorization: github {{github_pat}}' out> crates/synd_term/gql/schema.json
gen-gql:
graphql-client generate \
--schema-path crates/syndterm/gql/schema.json \
--output-directory crates/syndterm/src/client \
--response-derives "Debug" \
--custom-scalars-module "crate::client::scalar" \
crates/syndterm/gql/query.gql
graphql-client generate \
--schema-path crates/syndterm/gql/schema.json \
--output-directory crates/syndterm/src/client \
--response-derives "Debug" \
--custom-scalars-module "crate::client::scalar" \
crates/syndterm/gql/mutation.gql
graphql-client generate \
--schema-path crates/synd_api/src/client/github/schema.json \
--output-directory crates/synd_api/src/client/github \
--response-derives "Debug" \
crates/synd_api/src/client/github/query.gql
# Run kvsd
kvsd:
~/.cargo/bin/kvsd server --disable-tls --config dev/kvsd_config.yaml --username {{kvsd_user}}
# Run api
api:
cd crates/synd_api; \
RUST_LOG="info,synd_api=debug" \
OTEL_EXPORTER_OTLP_ENDPOINT={{otlp_endpoint}} \
cargo run --features "introspection" -- \
--kvsd-host 127.0.0.1 --kvsd-port 7379 --kvsd-username {{kvsd_user}} --kvsd-password secret
# Run term
term:
cd crates/synd_term; cargo run -- --log /tmp/syndterm.log
# Run opentelemetry-collector-contrib
# LOKI_ENDPOINT={{loki_endpoint}} \
@otelcol:
LOKI_ENDPOINT={{loki_endpoint}} \
otelcontribcol --config=file:./dev/otelcol-config.yaml