forked from kopeio/etcd-manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
78 lines (64 loc) · 2.13 KB
/
Makefile
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
# Copyright 2020 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
BAZEL_FLAGS=--features=pure --platforms=@io_bazel_rules_go//go/toolchain:linux_amd64
.PHONY: all
all: test
.PHONY: test
test:
bazel test //... --test_output=streamed
.PHONY: stress-test
stress-test:
bazel test //... --test_output=streamed --runs_per_test=10
.PHONY: gofmt
gofmt:
gofmt -w -s cmd/ pkg/
.PHONY: goimports
goimports:
goimports -w cmd/ pkg/ test/
.PHONY: push-etcd-manager
push-etcd-manager:
bazel run ${BAZEL_FLAGS} //images:push-etcd-manager
.PHONY: push-etcd-dump
push-etcd-dump:
bazel run ${BAZEL_FLAGS} //images:push-etcd-dump
.PHONY: push-etcd-backup
push-etcd-backup:
bazel run ${BAZEL_FLAGS} //images:push-etcd-backup
.PHONY: push
push: push-etcd-manager push-etcd-dump push-etcd-backup
echo "pushed images"
.PHONY: gazelle
gazelle:
bazel run //:gazelle -- fix
git checkout -- vendor
rm -f vendor/github.com/coreos/etcd/cmd/etcd
#rm vendor/github.com/golang/protobuf/protoc-gen-go/testdata/multi/BUILD.bazel
.PHONY: dep-ensure
dep-ensure:
echo "'make dep-ensure' has been replaced by 'make vendor'"
exit 1
.PHONY: vendor
vendor:
go mod vendor
find vendor/ -name "BUILD" -delete
find vendor/ -name "BUILD.bazel" -delete
bazel run //:gazelle
.PHONY: staticcheck-all
staticcheck-all:
go list ./... | xargs go run honnef.co/go/tools/cmd/staticcheck
# staticcheck-working is the subset of packages that we have cleaned up
# We gradually want to sync up staticcheck-all with staticcheck-working
.PHONY: staticcheck-working
staticcheck-working:
go list ./... | grep -v "etcd-manager/pkg/[cepv]" | xargs go run honnef.co/go/tools/cmd/staticcheck