-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yaml
66 lines (55 loc) · 1.96 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
# https://taskfile.dev
version: "3"
tasks:
cleanup:
desc: Remove the docker containers and volumes
cmds:
- docker compose down -v
digitalsign:
desc: Runs the digital sign TUI application
cmds:
- go build -o digitalsign ./cmd/digitalsign && ./digitalsign
kompose:
desc: Convert docker-compose to kubernetes manifests
cmds:
- kompose convert -o k8s
local-dev:
desc: Run the server with docker-composes
env:
DOCKER_BUILDKIT: 1
cmds:
- docker compose up -d db
- sleep 3 # wait for the database to start
- task: db:migrate
- docker compose up --build -d coffeehouse nats redis jaeger otel-collector
- sleep 1
- docker logs --follow coffeehouse-coffeehouse-1
db:migrate:
desc: Run the database migrations with docker
cmds:
- docker run -v $(pwd)/sql/schema:/migrations --network host migrate/migrate -path=/migrations/ -database postgres://user:password@localhost:5432/coffeehousedb?sslmode=disable up
db:rollback:
desc: Rollback the database migrations
cmds:
- docker run -v $(pwd)/sql/schema:/migrations --network host migrate/migrate -path=/migrations/ -database postgres://user:password@localhost:5432/coffeehousedb?sslmode=disable down 1
db:force:
desc: Force the database version to N
cmds:
- docker run -v $(pwd)/sql/schema:/migrations --network host migrate/migrate -path=/migrations/ -database postgres://user:password@localhost:5432/coffeehousedb?sslmode=disable force {{.CLI_ARGS}}
db:new_migration:
desc: Create a new migration
cmds:
- migrate create -ext sql -dir sql/schema -seq {{.CLI_ARGS}}
pgcli:
desc: Connect to the PostgreSQL database
env:
PGPASSWORD: password
cmds:
- pgcli -h localhost -U user -d coffeehousedb -w
run:
desc: Run the server application
env:
COFFEEHOUSE_DB_USER: user
COFFEEHOUSE_DB_PASSWORD: password
cmds:
- go run . --db-tls false