-
Notifications
You must be signed in to change notification settings - Fork 0
/
Taskfile.yml
57 lines (45 loc) · 1.3 KB
/
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
50
51
52
53
54
55
56
57
version: '2'
env:
GO111MODULE: on
GOPROXY: https://goproxy.cn
vars:
GIT_COMMIT:
sh: git describe --tags --always | sed 's/-/+/' | sed 's/^v//'
tasks:
update:
cmds:
- go mod tidy
- go mod vendor
fmt:
cmds:
- go fmt ./...
build:
cmds:
- go build -mod=vendor -ldflags="-s -w -X main.version={{.GIT_COMMIT}}"
test:
cmds:
- go vet -mod=vendor ./...
- go test -mod=vendor ./...
generate:
cmds:
- go generate -mod=vendor ./modules/...
release:
deps: [generate]
cmds:
- go build -mod=vendor -tags 'bindata' -ldflags="-s -w -X main.version={{.GIT_COMMIT}}" -o ftpd-{{OS}}-{{ARCH}}{{exeExt}}
release-linux:
deps: [generate]
cmds:
- GOOS=linux GOARCH=amd64 go build -mod=vendor -tags 'bindata' -ldflags="-s -w -X main.version={{.GIT_COMMIT}}" -o ftpd-linux-amd64
release-windows:
deps: [generate]
cmds:
- GOOS=windows GOARCH=amd64 go build -mod=vendor -tags 'bindata' -ldflags="-s -w -X main.version={{.GIT_COMMIT}}" -o ftpd-windows-amd64.exe
release-docker:
deps: [release-linux]
cmds:
- docker build . -t ftpd
clean-docker:
cmds:
- docker ps -a -q -f status=exited | xargs docker rm
- docker images --no-trunc=true --filter dangling=true --quiet | xargs docker rmi