-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
130 lines (113 loc) · 3.23 KB
/
Taskfile.yml
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
version: "3"
vars:
VERSION:
sh: git describe --tags --abbrev=0
COMMIT:
sh: git rev-parse --short HEAD
ROOT:
sh: git rev-parse --show-toplevel
OS:
sh: uname -s
TASKS:
sh: task -l
DOPPLER_TOKEN:
sh: skate get DOPPLER_NETWORK
includes:
hway: https://raw.githubusercontent.com/onsonr/taskfiles/main/taskfiles/hway.yml
ipfs: https://raw.githubusercontent.com/onsonr/taskfiles/main/taskfiles/ipfs.yml
sonrd: https://raw.githubusercontent.com/onsonr/taskfiles/main/taskfiles/sonrd.yml
synapse: https://raw.githubusercontent.com/onsonr/taskfiles/main/taskfiles/synapse.yml
tigerbeetle: https://raw.githubusercontent.com/onsonr/taskfiles/main/taskfiles/tigerbeetle.yml
tasks:
default:
cmds:
- gh run ls -L 3
- gum format -- "# Sonr ({{.OS}}-{{.VERSION}})" " - ({{.COMMIT}}) {{.ROOT}}"
- task -l -j | jq -r '.tasks[].name' | fzf --height=16 | xargs task
silent: true
deps:
desc: Install go dependencies
silent: true
vars:
DEPS:
[
"github.com/apple/pkl-go/cmd/pkl-gen-go@latest",
"github.com/sqlc-dev/sqlc/cmd/sqlc@latest",
"github.com/goreleaser/goreleaser/v2@latest",
"github.com/a-h/templ/cmd/templ@latest",
]
cmds:
- for: { var: DEPS }
cmd: gum spin --spinner dot --title "Installing go dependencies..." -- go install {{.ITEM}}
pkl-gen:
desc: Generate PKL files
silent: true
dir: "pkl/sonr.net"
vars:
FILES: ["Hway.pkl", "Motr.pkl", "UCAN.pkl"]
cmds:
- for: { var: FILES }
cmd: gum spin --spinner dot --title "Generating PKL in Go..." -- pkl-gen-go {{.ITEM}}
proto-gen:
desc: Generate proto files
silent: true
cmd: gum spin --spinner dot --title "Generating Protobufs..." -- make proto-gen
sqlc-gen:
desc: Generate SQLC files
silent: true
cmds:
- gum spin --spinner dot --title "Generating SQLC..." -- sqlc generate -f internal/database/sqlc.yaml
templ-gen:
desc: Generate templ files
silent: true
cmd: gum spin --spinner dot --title "Generating Templ..." -- templ generate
start:
desc: Start the Network
silent: true
cmds:
- task: postgres:reset
- task: ipfs:init
- task: ipfs:mount
- task: sonrd:install
- task: hway:build
- task: procs-up
status:
desc: Check the status of the Network
silent: true
cmds:
- task: procs-attach
stop:
desc: Stop the Network
silent: true
cmds:
- task: procs-down
procs-up:
internal: true
dir: "deploy"
cmds:
- cmd: process-compose up
platforms:
- darwin
- cmd: process-compose up --use-uds --unix-socket /tmp/sonr-network.sock -D
platforms:
- linux
procs-down:
internal: true
dir: "deploy"
cmds:
- cmd: process-compose down
platforms:
- darwin
- cmd: process-compose down --use-uds --unix-socket /tmp/sonr-network.sock
platforms:
- linux
procs-attach:
internal: true
dir: "deploy"
cmds:
- cmd: process-compose attach --use-uds --unix-socket /tmp/sonr-network.sock
platforms:
- linux
- cmd: process-compose attach
platforms:
- darwin