-
Notifications
You must be signed in to change notification settings - Fork 36
/
Makefile
36 lines (28 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
31
32
33
34
35
36
##################################################
# Variables #
##################################################
VERSION ?= master
IMAGE_REGISTRY ?= docker.io
IMAGE_REPO ?= REPOSITORY_NAME
IMAGE = $(IMAGE_REGISTRY)/$(IMAGE_REPO)/eventing-autoscaler-keda:$(VERSION)
ARCH ?=amd64
CGO ?=0
TARGET_OS ?=linux
GIT_VERSION = $(shell git describe --always --abbrev=7)
GIT_COMMIT = $(shell git rev-list -1 HEAD)
DATE = $(shell date -u +"%Y.%m.%d.%H.%M.%S")
##################################################
# Build #
##################################################
GO_BUILD_VARS= GO111MODULE=on CGO_ENABLED=$(CGO) GOOS=$(TARGET_OS) GOARCH=$(ARCH)
.PHONY: gofmt
gofmt:
go fmt ./...
.PHONY: build
build: gofmt
rm -rf ./build/*
mkdir -p ./build
$(GO_BUILD_VARS) go build -mod vendor -o build/eventing-autoscaler-keda cmd/controller/main.go
.PHONY: build-image
build-image: build
docker build -t $(IMAGE) ./