forked from jetstack-experimental/kube2consul
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
22 lines (17 loc) · 751 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
IMAGE_NAME:=jetstackexperimental/kube2consul
build: version
CGO_ENABLED=0 GOOS=linux go build \
-a -tags netgo \
-o kube2consul \
-ldflags "-X main.AppGitState=${GIT_STATE} -X main.AppGitCommit=${GIT_COMMIT} -X main.AppVersion=${APP_VERSION}"
image: build
docker build -t $(IMAGE_NAME):latest .
docker build -t $(IMAGE_NAME):$(APP_VERSION) .
push: image
docker push $(IMAGE_NAME):latest $(IMAGE_NAME):$(APP_VERSION)
codegen:
mockgen -package=mocks -source=pkg/interfaces/interfaces.go > pkg/mocks/mocks.go
version:
$(eval GIT_STATE := $(shell if test -z "`git status --porcelain 2> /dev/null`"; then echo "clean"; else echo "dirty"; fi))
$(eval GIT_COMMIT := $(shell git rev-parse HEAD))
$(eval APP_VERSION := $(shell cat VERSION))