forked from blackdevil92/hatchet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yaml
159 lines (153 loc) · 4.89 KB
/
Taskfile.yaml
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
version: "3"
tasks:
setup:
cmds:
- |
task install-dependencies &&
task generate-certs &&
task set-env-db &&
task prisma-migrate &&
task generate-all &&
task generate-local-encryption-keys &&
task set-env-all &&
task seed-dev &&
task copy-ca-to-sdks
set-env-db:
cmds:
- |
cat > .env <<EOF
DATABASE_URL='postgresql://hatchet:[email protected]:5431/hatchet'
EOF
set-env-all:
cmds:
- |
randstring() { openssl rand -base64 69 | tr -d "\n" | tr -d "=+/" | cut -c1-$1; }
cat > .env <<EOF
DATABASE_URL='postgresql://hatchet:[email protected]:5431/hatchet'
SERVER_TLS_CERT_FILE=./hack/dev/certs/cluster.pem
SERVER_TLS_KEY_FILE=./hack/dev/certs/cluster.key
SERVER_TLS_ROOT_CA_FILE=./hack/dev/certs/ca.cert
SERVER_ENCRYPTION_MASTER_KEYSET_FILE=./hack/dev/encryption-keys/master.key
SERVER_ENCRYPTION_JWT_PRIVATE_KEYSET_FILE=./hack/dev/encryption-keys/private_ec256.key
SERVER_ENCRYPTION_JWT_PUBLIC_KEYSET_FILE=./hack/dev/encryption-keys/public_ec256.key
SERVER_PORT=8080
SERVER_URL=https://app.dev.hatchet-tools.com
SERVER_AUTH_COOKIE_SECRETS="$(randstring 16) $(randstring 16)"
SERVER_AUTH_COOKIE_DOMAIN=app.dev.hatchet-tools.com
SERVER_AUTH_COOKIE_INSECURE=false
SERVER_AUTH_SET_EMAIL_VERIFIED=true
SERVER_LOGGER_LEVEL=debug
SERVER_LOGGER_FORMAT=console
DATABASE_LOGGER_LEVEL=debug
DATABASE_LOGGER_FORMAT=console
EOF
start-db:
cmds:
- docker compose up -d
stop-db:
cmds:
- docker compose down
set-etc-hosts:
cmds:
- sudo sh ./hack/dev/manage-hosts.sh add 127.0.0.1 app.dev.hatchet-tools.com
prisma-migrate:
cmds:
- sh ./hack/dev/run-go-with-env.sh run github.com/steebchen/prisma-client-go migrate dev
seed-dev:
cmds:
- sh ./hack/dev/run-go-with-env.sh run github.com/steebchen/prisma-client-go migrate dev --skip-generate
- SEED_DEVELOPMENT=true sh ./hack/dev/run-go-with-env.sh run ./cmd/hatchet-admin seed
start-dev:
deps:
- task: start-db
- task: start-api
- task: start-engine
- task: start-frontend
start-api:
cmds:
- sh ./hack/dev/start-api.sh
start-engine:
cmds:
- sh ./hack/dev/start-engine.sh
start-frontend:
cmds:
- sh ./hack/dev/start-frontend.sh
start-ngrok:
cmds:
- ngrok http 8080
generate-all:
cmds:
- task: install-dependencies
- task: generate-api
- task: generate-go
- task: generate-proto
- task: generate-sqlc
install-dependencies:
cmds:
- go mod download
- npm install @openapitools/openapi-generator-cli -g
- openapi-generator-cli version-manager set 7.3.0
- cd frontend/app/ && pnpm install
- cd frontend/docs/ && pnpm install
generate-api:
cmds:
- task: generate-api-server
- task: generate-api-client
generate-certs:
cmds:
- sh ./hack/dev/generate-x509-certs.sh ./hack/dev/certs
generate-local-encryption-keys:
cmds:
- sh ./hack/dev/generate-local-encryption-keys.sh ./hack/dev/encryption-keys
generate-dev-api-token:
cmds:
- sh ./hack/dev/generate-dev-api-token.sh
generate-api-server:
cmds:
- sh ./hack/oas/generate-server.sh
silent: true
generate-api-client:
cmds:
- sh ./hack/oas/generate-clients.sh
silent: true
generate-go:
cmds:
- go generate ./...
generate-proto:
cmds:
- sh ./hack/proto/proto.sh
generate-proto-python:
dir: ./python-sdk
cmds:
- sh ./generate.sh
generate-sqlc:
cmds:
- npx --yes prisma migrate diff --from-empty --to-schema-datasource prisma/schema.prisma --script > internal/repository/prisma/dbsqlc/schema.sql
- go run github.com/sqlc-dev/sqlc/cmd/[email protected] generate --file internal/repository/prisma/dbsqlc/sqlc.yaml
lint:
cmds:
- task: lint-go
- task: lint-frontend
lint-go:
cmds:
- golangci-lint run ./... --config .golangci.yml
lint-frontend:
cmds:
- cd frontend/app/ && pnpm run lint:check
kill-query-engines:
cmds:
- ps -A | grep 'prisma-query-engine-darwin-arm64' | grep -v grep | awk '{print $1}' | xargs kill -9 $1
kill-apis:
cmds:
- ps -A | grep 'cmd/hatchet-api' | grep -v grep | awk '{print $1}' | xargs kill -9 $1
- ps -A | grep 'exe/hatchet-api' | grep -v grep | awk '{print $1}' | xargs kill -9 $1
kill-engines:
cmds:
- ps -A | grep 'cmd/hatchet-engine' | grep -v grep | awk '{print $1}' | xargs kill -9 $1
- ps -A | grep 'exe/hatchet-engine' | grep -v grep | awk '{print $1}' | xargs kill -9 $1
prisma-studio:
cmds:
- sh ./hack/dev/run-npx-with-env.sh prisma studio
copy-ca-to-sdks:
cmds:
- mkdir -p ./python-sdk/certs/ && cp ./hack/dev/certs/ca.cert ./python-sdk/certs/