This repository has been archived by the owner on Sep 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Taskfile.yml
75 lines (67 loc) · 1.58 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
version: "2"
vars:
ARGS: ""
os:
sh: go env GOOS
arch:
sh: go env GOARCH
kbversion: 2.2.0
kbdir: ./.kubebuilder
checksum_cmd: "shasum -a 256"
env:
KUBEBUILDER_ASSETS: "{{.kbdir}}/bin"
tasks:
lint:
cmds:
- golangci-lint run
sources:
- ./**/*.go
test:
desc: Run full test suite
deps:
- kubebuilder
cmds:
- go test -cover -covermode=atomic -coverprofile c.out -race ./...
generates:
- c.out
sources:
- ./**/*.go
- ./go.mod
- ./go.sum
build:
desc: Build binary
cmds:
- go build -o pomerium-operator cmd/pomerium-operator/*.go
generates:
- pomerium-operator
sources:
- ./**/*.go
- ./go.mod
- ./go.sum
release:
desc: Generate release assets
vars:
BINARY: pomerium-operator-{{.os}}-{{.arch}}
cmds:
- mkdir -p ./dist
- go build -o dist/{{.BINARY}} cmd/pomerium-operator/*.go
- cd dist && {{.checksum_cmd}} {{.BINARY}} > {{.BINARY}}.sha256
run:
desc: Run in debug mode with $ARGS as arguments
cmds:
- go run cmd/pomerium-operator/*.go --debug "{{.ARGS}}"
kubebuilder:
desc: Install kubebuilder for testing
cmds:
- curl -L https://go.kubebuilder.io/dl/{{.kbversion}}/{{.os}}/{{.arch}} | tar -xz -C /tmp/
- mv /tmp/kubebuilder_{{.kbversion}}_{{.os}}_{{.arch}} .kubebuilder
status:
- test -d "{{.kbdir}}/bin"
generates:
- "{{.kbdir}}/bin/*"
clean:
desc: Clean binary and kubebuilder
cmds:
- rm -rf .kubebuilder
- rm -f pomerium-operator
- rm -f c.out