forked from openshift/assisted-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (31 loc) · 1.26 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
INSTALLER := $(or ${INSTALLER},quay.io/ocpmetal/assisted-installer:stable)
GIT_REVISION := $(shell git rev-parse HEAD)
CONTROLLER := $(or ${CONTROLLER}, quay.io/ocpmetal/assisted-installer-controller:stable)
all: image image_controller unit-test
lint:
golangci-lint run -v
format:
goimports -w -l src/ || /bin/true
generate:
go generate $(shell go list ./...)
$(MAKE) format
unit-test:
go test -v $(shell go list ./...) -cover -ginkgo.focus=${FOCUS} -ginkgo.v
ut:
go test -v -coverprofile=coverage.out ./... && go tool cover -html=coverage.out && rm coverage.out
build/installer: lint format
mkdir -p build
CGO_ENABLED=0 go build -o build/installer src/main/main.go
build/controller: lint format
mkdir -p build
CGO_ENABLED=0 go build -o build/assisted-installer-controller src/main/assisted-installer-controller/assisted_installer_main.go
image: build/installer
GIT_REVISION=${GIT_REVISION} docker build --build-arg GIT_REVISION -f Dockerfile.assisted-installer . -t $(INSTALLER)
push: image
docker push $(INSTALLER)
image_controller: build/controller
GIT_REVISION=${GIT_REVISION} docker build --build-arg GIT_REVISION -f Dockerfile.assisted-installer-controller . -t $(CONTROLLER)
push_controller: image_controller
docker push $(CONTROLLER)
clean:
rm -rf build