-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjustfile
More file actions
53 lines (38 loc) · 1 KB
/
justfile
File metadata and controls
53 lines (38 loc) · 1 KB
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
bin := "btc-buf"
gen:
buf format -w proto
buf generate --template buf.gen.yaml
cd gen && go mod tidy
build:
go build -v -o ./{{ bin }} .
run *args:
go run -v . {{ args }}
lint args='':
golangci-lint run {{ args }}
format: format-go format-proto
format-go:
WRITE=1 bash scripts/check-goimports.sh
WRITE=1 bash scripts/check-gogroup.sh
format-proto:
buf format -w proto
clean:
rm -rf {{ bin }} gen
image:
docker buildx build --progress plain --platform linux/amd64 -t barebitcoin/btc-buf:$(git rev-parse --short HEAD) .
image-push: image
docker push barebitcoin/btc-buf:$(git rev-parse --short HEAD)
[positional-arguments]
curl *args='':
#!/usr/bin/env bash
set -euo pipefail
url=""
rest=()
for a in "$@"; do
if [[ -z "$url" && "$a" == /* ]]; then
url="http://localhost:5080$a"
else
rest+=("$a")
fi
done
[[ -n "$url" ]] || { echo "Error: No service URL found" >&2; exit 1; }
buf curl --schema . --timeout=30m --emit-defaults "$url" "${rest[@]}"