-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
30 lines (23 loc) · 1 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
BUILD_COMMIT := $(shell ./scripts/build/get-build-commit.sh)
BUILD_TIMESTAMP := $(shell ./scripts/build/get-build-timestamp.sh)
BUILD_HOSTNAME := $(shell ./scripts/build/get-build-hostname.sh)
LDFLAGS := "-X github.com/redhat-cop/project-initialize-operator/version.Version=$(VERSION) \
-X github.com/redhat-cop/project-initialize-operator/version.Vcs=$(BUILD_COMMIT) \
-X github.com/redhat-cop/project-initialize-operator/version.Timestamp=$(BUILD_TIMESTAMP) \
-X github.com/redhat-cop/project-initialize-operator/version.Hostname=$(BUILD_HOSTNAME)"
all: operator
# Build manager binary
operator: generate fmt vet
go build -o build/_output/bin/project-initialize-operator -ldflags $(LDFLAGS) github.com/redhat-cop/project-initialize-operator/cmd/manager
# Run go fmt against code
fmt:
go fmt ./pkg/... ./cmd/...
# Run go vet against code
vet:
go vet ./pkg/... ./cmd/...
# Generate code
generate:
go generate ./pkg/... ./cmd/...
# Test
test: generate fmt vet
go test ./pkg/... ./cmd/... -coverprofile cover.out