forked from rugwirobaker/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
49 lines (40 loc) · 1004 Bytes
/
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
version: '3'
dotenv: ['.env']
output: prefixed
silent: true
tasks:
default:
desc: Default task
cmds:
- task: run
build:
desc: Build the application
cmds:
- echo "compiling binary..."
- CGO_ENABLED=0 go build -ldflags="{{.LDFLAGS}}" -o bin/hermes ./cmd/hermes
vars:
VERSION:
sh: git rev-parse --short HEAD
DATE:
sh: date -u +%Y-%m-%d-%H:%M:%S-%Z
LDFLAGS: "-X github.com/rugwirobaker/hermes.version={{.VERSION}} -X github.com/rugwirobaker/hermes.buildDate={{.DATE}}"
generate:
desc: Generate code
cmds:
- go generate ./...
image:
desc: Build the application container images
cmds:
- docker build --network host -t hermes:{{.GIT_COMMIT}} .
vars:
GIT_COMMIT:
sh: git rev-parse --short HEAD
run:
desc: Start the application
deps: [build]
cmds:
- ./bin/hermes
test:
desc: Run unit tests
cmds:
- go test -race -covermode=atomic ./...