forked from hiddeco/cronjobber
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
50 lines (38 loc) · 1.34 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
TAG?=latest
VERSION:=$(shell ./scripts/image-tag)
VCS_REF:=$(shell git rev-parse HEAD)
BUILD_DATE:=$(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
BUILD_TARGET?=cronjobber
SOURCE_DIRS=cmd pkg/apis pkg/controller pkg/logging pkg/version
TEST_FLAGS?=
run:
go run cmd/cronjobber/* -kubeconfig=${HOME}/.kube/config -log-level=info
build: build/cronjobber build/updatetz
build/cronjobber:
docker build -t hiddeco/cronjobber:$(TAG) \
--build-arg VERSION="$(VERSION)" \
--build-arg VCS_REF="$(VCS_REF)" \
--build-arg BUILD_DATE="$(BUILD_DATE)" \
--target $(BUILD_TARGET) \
${PWD}
build/updatetz:
docker build -t hiddeco/cronjobber-updatetz:$(TAG) \
--build-arg VCS_REF="$(VCS_REF)" \
--build-arg BUILD_DATE="$(BUILD_DATE)" \
${PWD}/updatetz
push: push/cronjobber push/updatetz
push/cronjobber:
docker tag hiddeco/cronjobber:$(TAG) quay.io/hiddeco/cronjobber:$(VERSION)
docker push quay.io/hiddeco/cronjobber:$(VERSION)
push/updatetz:
docker tag hiddeco/cronjobber-updatetz:$(TAG) quay.io/hiddeco/cronjobber-updatetz:$(VERSION)
docker push quay.io/hiddeco/cronjobber-updatetz:$(VERSION)
fmt:
gofmt -l -s -w $(SOURCE_DIRS)
test-fmt:
gofmt -l -s $(SOURCE_DIRS) | grep ".*\.go"; if [ "$$?" = "0" ]; then exit 1; fi
test-codegen:
./hack/verify-codegen.sh
git diff --exit-code -- pkg/apis pkg/client
test: test-fmt test-codegen
go test $(TEST_FLAGS) ./...