forked from sanster23/k8s-prow-guide
-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathMakefile
50 lines (32 loc) · 1.32 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
GO_APP_BINARY ?= main
DOCKER_REPO ?= shekhawatsanjay
IMAGE ?= go-hello-world
VERSION ?= $(shell date +v%Y%m%d)-$(shell git describe --tags --always --dirty)
all: test build
clean: ## Clear all the .pyc/.pyo files and virtual env files.
go clean
rm -f $(GO_APP_BINARY)
test:
go test -v -race -cover ./...
build:
go build -v hello.go
run: build
./$(GO_APP_BINARY)
build-image:
docker build --cache-from docker.io/$(DOCKER_REPO)/$(IMAGE):latest \
-t docker.io/$(DOCKER_REPO)/$(IMAGE):$(VERSION) \
-t docker.io/$(DOCKER_REPO)/$(IMAGE):latest .
push-image:
docker push docker.io/$(PROJECT)/$(IMAGE):latest
docker push docker.io/$(PROJECT)/$(IMAGE):$(VERSION)
ci-release: clean test build build-image push-image
.PHONY: clean test build-image push-image ci-release
update-config:
kubectl create configmap config --from-file=config.yaml=prow/config.yaml --dry-run -o yaml | kubectl replace configmap config -f -
update-plugins:
kubectl create configmap plugins --from-file=plugins.yaml=prow/plugins.yaml --dry-run -o yaml | kubectl replace configmap plugins -f -
update-jobs:
kubectl create configmap job-config --from-file=prow/jobs/ --dry-run -o yaml | kubectl replace configmap job-config -f -
deploy-prow:
kubectl create -f prow/cluster/prow-starter.yaml
.PHONY: update-config update-plugins update-jobs deploy-prow