forked from operator-framework/operator-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
84 lines (59 loc) · 1.92 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
79
80
81
82
83
84
# kernel-style V=1 build verbosity
ifeq ("$(origin V)", "command line")
BUILD_VERBOSE = $(V)
endif
ifeq ($(BUILD_VERBOSE),1)
Q =
else
Q = @
endif
VERSION = $(shell git describe --dirty --tags --always)
REPO = github.com/operator-framework/operator-sdk
BUILD_PATH = $(REPO)/commands/operator-sdk
PKGS = $(shell go list ./... | grep -v /vendor/)
export CGO_ENABLED:=0
all: format test build/operator-sdk
format:
$(Q)go fmt $(PKGS)
dep:
$(Q)dep ensure -v
clean:
$(Q)rm -rf build
.PHONY: all test format dep clean
install:
$(Q)go install $(BUILD_PATH)
release_x86_64 := \
build/operator-sdk-$(VERSION)-x86_64-linux-gnu \
build/operator-sdk-$(VERSION)-x86_64-apple-darwin
release: clean $(release_x86_64)
build/operator-sdk-%-x86_64-linux-gnu: GOARGS = GOOS=linux GOARCH=amd64
build/operator-sdk-%-x86_64-apple-darwin: GOARGS = GOOS=darwin GOARCH=amd64
build/%:
$(Q)$(GOARGS) go build -o $@ $(BUILD_PATH)
DEFAULT_KEY = $(shell gpgconf --list-options gpg \
| awk -F: '$$1 == "default-key" { gsub(/"/,""); print toupper($$10)}')
GIT_KEY = $(shell git config --get user.signingkey | awk '{ print toupper($$0) }')
build/%.asc:
ifeq ("$(DEFAULT_KEY)","$(GIT_KEY)")
$(Q)gpg --output $@ --detach-sig build/$*
$(Q)gpg --verify $@ build/$*
else
@echo "git and/or gpg are not configured to have default signing key ${DEFAULT_KEY}"
@exit 1
endif
.PHONY: install release_x86_64 release
test: dep test/sanity test/unit install test/subcommand test/e2e
test/ci-go: test/sanity test/unit test/subcommand test/e2e/go
test/ci-ansible: test/e2e/ansible
test/sanity:
./hack/tests/sanity-check.sh
test/unit:
./hack/tests/unit.sh
test/subcommand:
./hack/tests/test-subcommand.sh
test/e2e: test/e2e/go test/e2e/ansible
test/e2e/go:
./hack/tests/e2e-go.sh
test/e2e/ansible:
./hack/tests/e2e-ansible.sh
.PHONY: test test/sanity test/unit test/subcommand test/e2e test/e2e/go test/e2e/ansible test/ci-go test/ci-ansible