Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/spicedb/BUILD.yaml
2492 views
1
packages:
2
- name: schema
3
type: generic
4
srcs:
5
- "schema/*.yaml"
6
config:
7
test:
8
- ["zed", "validate", "./schema/schema.yaml"]
9
10
- name: lib
11
type: go
12
srcs:
13
- go.mod
14
- go.sum
15
- "*.go"
16
- "schema/*.yaml"
17
deps:
18
- components/spicedb:schema
19
env:
20
- CGO_ENABLED=0
21
config:
22
packaging: library
23
scripts:
24
- name: start-spicedb
25
description: "Starts spicedb if not already running."
26
shell: bash
27
script: |
28
set -e
29
30
leeway run components/spicedb:stop-spicedb || true
31
32
spicedb serve-testing --log-level debug --load-configs schema/schema.yaml &
33
34
for i in {1..50}; do
35
if nc -z 0.0.0.0 50051; then
36
echo "Started spicedb."
37
exit 0
38
fi
39
sleep 0.2
40
done
41
42
echo "Failed to start spicedb."
43
docker logs test-spicedb
44
45
sleep 300
46
exit 1
47
- name: stop-spicedb
48
description: "Stops spicedb if running."
49
deps: []
50
script: |
51
# stop the service on 50051 if it runs
52
if nc -z 0.0.0.0 50051; then
53
# kill
54
kill $(lsof -t -i:50051)
55
echo "Stopped spicedb."
56
fi
57
58
- name: generate-ts
59
description: "Generate definition in typescript."
60
deps: []
61
script: |
62
(cd codegen && go run .)
63
64