-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
104 lines (94 loc) · 1.98 KB
/
Copy pathTaskfile.yaml
File metadata and controls
104 lines (94 loc) · 1.98 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
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
version: '3'
env:
DATABASE_USER: postgres
DATABASE_PASSWORD: postgres
DATABASE_HOST: localhost
DATABASE_NAME: postgres
GOPATH:
sh: go env GOPATH
TZ: UTC
PARALLEL: 4
tasks:
install:
deps:
- migrate:install
- lint:install
- test:install
migrate:install:
status:
- test -f $GOPATH/bin/tern
cmds:
- go install github.com/jackc/tern@latest
migrate:up:
deps:
- migrate:install
desc: Run all up migrations.
cmds:
- tern migrate -m migrations -c migrations/tern.conf
migrate:down:
deps:
- migrate:install
desc: Run all down migrations.
cmds:
- tern migrate -d 0 -m migrations -c migrations/tern.conf
migrate:fresh:
deps:
- migrate:install
desc: Run all migrations from the ground.
cmds:
- task: migrate:down
- task: migrate:up
migrate:new:
deps:
- migrate:install
cmds:
- tern new {{.CLI_ARGS}} -m migrations
lint:install:
status:
- test -f $GOPATH/bin/golangci-lint
cmds:
- go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
lint:
deps:
- lint:install
- mocks
cmds:
- golangci-lint run
test:install:
status:
- go version
- test -f $GOPATH/bin/gotestsum
cmds:
- go install gotest.tools/gotestsum@latest
test:
deps:
- test:install
- migrate:fresh
- mocks
cmds:
- gotestsum --junitfile=unit-tests.xml -- -timeout 30s -race -parallel $PARALLEL -count=1 ./...
docker:package:
cmds:
- docker build -t {{.IMAGE}} .
mocks:install:
status:
- test -f $GOPATH/bin/mockery
cmds:
- go install github.com/vektra/mockery/v2@v2.42.0
mocks:
deps:
- mocks:install
cmds:
- mockery
run:
deps:
- install
cmds:
- go run main.go
ci:
cmds:
- task: lint
- task: test
deploy:
cmds:
- ../../deploy/deploy.sh {{.IMAGE_BASE}} -f Dockerfile .