-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
48 lines (40 loc) · 2.26 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
ECHO := echo -e
all: verify-config
.PHONY: config
config: verify-config run-config verify-config
.PHONY: run-config
run-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:
@ $(ECHO) "\033[36mVerifying Config\033[0m"
docker run --rm -v $(shell pwd)/config:/config gcr.io/k8s-prow/checkconfig:v20200305-e8ef9758b \
--config-path=/config/config.yaml \
--job-config-path=/config/jobs \
--plugin-config=/config/plugins.yaml
@ $(ECHO) # Spacer between output
make run-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
.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