-
Notifications
You must be signed in to change notification settings - Fork 1
/
Taskfile.yml
134 lines (117 loc) · 2.7 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
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
# https://taskfile.dev
version: '3'
env:
COBRA_CLI_VERSION: v1.5.0
GOLANGCI_LINT_VERSION: v1.50.0
GORELEASER_VERSION: v1.11.5
KUBECTL_SLICE_VERSION: v1.2.3
KUSTOMIZE_MAJOR: v4
KUSTOMIZE_VERSION: v4.5.7
tasks:
default:
deps:
- build
- lint
# in case you want to use go install for stuff
cli:
cmds:
- export
- GOBIN=${PWD} go install .
generates:
- obnpctl
sources:
- ./**/*.go
- go.mod
- go.sum
status:
- test -f obnpctl
test-with-coverage:
deps:
- lint
cmds:
- go test -covermode atomic -coverprofile='profile.cov' ./...
generates:
- profile.cov
status:
- test -f profile.cov
build:
deps:
- goreleaser
cmds:
- ./bin/goreleaser release
--snapshot
--rm-dist
--skip-sign # cosign only works for github actions
generates:
- dist/**
sources:
- ./**/*.go
- go.mod
- go.sum
lint:
deps:
- golangci-lint
cmds:
- ./bin/golangci-lint run
sources:
- ./**/*.go
- go.mod
- go.sum
lint-fix:
deps:
- golangci-lint
cmds:
- ./bin/golangci-lint run --fix
deploy-up:
deps:
- kustomize
- kubectl-slice
- oc
cmds:
- ./bin/kustomize build ./deploy/config/ | oc apply -f -
- ./deploy/config/is_up.sh
deploy-down:
deps:
- kustomize
- oc
cmds:
- ./bin/kustomize build ./deploy/config/ | oc delete -f - --ignore-not-found
- ./deploy/config/is_down.sh
cobra-cli:
cmds:
- GOBIN=${PWD}/bin go install -mod=readonly github.com/spf13/cobra-cli@${COBRA_CLI_VERSION}
generates:
- bin/cobra-cli
status:
- test -f bin/cobra-cli
golangci-lint:
cmds:
- GOBIN=${PWD}/bin go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}
generates:
- bin/golangci-lint
status:
- test -f bin/golangci-lint
goreleaser:
cmds:
- GOBIN=${PWD}/bin go install github.com/goreleaser/goreleaser@${GORELEASER_VERSION}
generates:
- bin/goreleaser
status:
- test -f bin/goreleaser
kustomize:
cmds:
- GOBIN=${PWD}/bin go install -mod=readonly sigs.k8s.io/kustomize/kustomize/${KUSTOMIZE_MAJOR}@${KUSTOMIZE_VERSION}
generates:
- bin/kustomize
status:
- test -f bin/kustomize
kubectl-slice:
cmds:
- GOBIN=${PWD}/bin go install -mod=readonly github.com/patrickdappollonio/kubectl-slice@${KUBECTL_SLICE_VERSION}
generates:
- bin/kubectl-slice
status:
- test -f bin/kubectl-slice
oc:
status:
- test which oc