-
Notifications
You must be signed in to change notification settings - Fork 7
/
Taskfile.yml
37 lines (35 loc) · 825 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
version: '2'
vars:
NAME: packer-builder-qemu-chroot
VERSION: 1.1.0
COMMIT: {sh: git rev-parse --verify HEAD}
BUILD_FLAGS: -ldflags "-X main.VERSION={{.VERSION}} -X main.COMMIT={{.COMMIT}}"
tasks:
build:
cmds:
- go build {{.BUILD_FLAGS}} .
test:
cmds:
- go vet ./...
- go test -v -coverprofile=cover.out ./...
cover:
deps: [test]
cmds:
- go tool cover -html=cover.out
package:
cmds:
- GOOS={{.OS}} GOARCH={{.ARCH}} go build {{.BUILD_FLAGS}} .
- tar -czf dist/{{.NAME}}_{{.OS}}_{{.ARCH}}.tar.gz {{.NAME}}
- rm -rf {{.NAME}}
dist:
deps: [test]
cmds:
- mkdir -p dist
- task: package
vars: {OS: "linux", ARCH: "amd64"}
vendor:
cmds:
- dep ensure -v
clean:
cmds:
- rm -rf {{.NAME}} dist cover.out