forked from pusher/testing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
52 lines (44 loc) · 2.75 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
51
52
ECHO := echo -e
all: verify-config verify-image-tags
.PHONY: config
config:
@ $(ECHO) "\033[36mGenerating Config\033[0m"
kubectl create configmap config --from-file=config.yaml=config/config.yaml -n default --dry-run -o yaml > prow/config.yaml
kubectl create configmap plugins --from-file=plugins.yaml=config/plugins.yaml -n default --dry-run -o yaml > prow/plugins.yaml
scripts/make-jobs-config.sh > prow/jobs.yaml
@for f in config plugins jobs; do printf '#############\n###\n### THIS IS AN AUTOGENERATED FILE!!! DO NOT EDIT THIS FILE DIRECTLY!!!\n###\n#############\n\n%s\n' "$$(cat prow/$${f}.yaml)" > prow/$${f}.yaml; done
@ echo # Produce a new line at the end of each target to help readability
.PHONY: verify-config
verify-config: $(GOPATH)/bin/checkconfig
@ $(ECHO) "\033[36mVerifying Config\033[0m"
${GOPATH}/bin/checkconfig --config-path=config/config.yaml --job-config-path=config/jobs --plugin-config=config/plugins.yaml
@ echo # Spacer between output
make config
@ $(ECHO) "\033[36mVerifying Git Status\033[0m"
@ if [ "$$(git status -s)" != "" ]; then git diff --color; $(ECHO) "\033[31;1mERROR: Git Diff found. Please run \`make config\` and commit the result.\033[0m"; exit 1; else $(ECHO) "\033[32mValid config found\033[0m";fi
@ echo # Produce a new line at the end of each target to help readability
$(GOPATH)/bin/checkconfig:
@ $(ECHO) "\033[36mInstalling checkconfig\033[0m"
mkdir -p $$GOPATH/src/k8s.io
# Clone the test-infra source so that we can use the proper go.mod
cd $$GOPATH/src/k8s.io; git clone https://github.com/kubernetes/test-infra
# This is the same Git SHA that the images we use are tagged with
cd $$GOPATH/src/k8s.io/test-infra; git checkout 3b3e19a133321bb9e451f1c7ce11ed8d8561705f
cd $$GOPATH/src/k8s.io/test-infra; GOPROXY=https://proxy.golang.org GOSUMDB=sum.golang.org GO111MODULE=on go install k8s.io/test-infra/prow/cmd/checkconfig
@ echo # Produce a new line at the end of each target to help readability
.PHONY:
check-image-tags:
@ $(ECHO) "\033[36m\033[1mChecking image tags\033[0m"
scripts/check-image-tags.sh
@ echo # Produce a new line at the end of each target to help readability
TAG ?= v20190821-328974b
.PHONY:
update-image-tags:
@ $(ECHO) "\033[36m\033[1mUpdating image tags\033[0m"
scripts/update-image-tags.sh $(TAG)
@ echo # Produce a new line at the end of each target to help readability
.PHONY:
verify-image-tags: update-image-tags check-image-tags
@ $(ECHO) "\033[36m\033[1mVerifying Git Status\033[0m"
@ if [ "$$(git status -s)" != "" ]; then git diff --color; $(ECHO) "\033[31m\033[1mERROR: Git Diff found. Please run \`make update-image-tags\` and commit the result.\033[0m"; exit 1; else $(ECHO) "\033[32mAll image tags verified\033[0m";fi
@ echo # Produce a new line at the end of each target to help readability