forked from strimzi/strimzi-kafka-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
29 lines (22 loc) · 1.11 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
RELEASE_VERSION ?= latest
SUBDIRS=kafka-base zookeeper kafka-statefulsets kafka-inmemory kafka-connect kafka-connect/s2i metrics
DOCKER_TARGETS=docker_build docker_push docker_tag
all: $(SUBDIRS)
$(DOCKER_TARGETS): $(SUBDIRS)
release: release_prepare $(SUBDIRS) release_version release_pkg
release_prepare:
rm -rf ./strimzi-$(RELEASE_VERSION)
rm -f ./strimzi-$(RELEASE_VERSION).tar.gz
mkdir ./strimzi-$(RELEASE_VERSION)
cp README.md ./strimzi-$(RELEASE_VERSION)
release_version:
echo "Changing Docker image tags from :latest to :$(RELEASE_VERSION)"
find ./strimzi-$(RELEASE_VERSION)/ -name '*.yaml' -type f -exec sed -i '/image: "*strimzi\/[a-zA-Z0-9_-]*:latest"*/s/:latest/:$(RELEASE_VERSION)/g' {} \;
find ./strimzi-$(RELEASE_VERSION)/ -name '*.yaml' -type f -exec sed -i '/name: [a-zA-Z0-9_-]*IMAGE_TAG/{n;s/latest/$(RELEASE_VERSION)/}' {} \;
release_pkg:
tar -z -cf ./strimzi-$(RELEASE_VERSION).tar.gz strimzi-$(RELEASE_VERSION)/
zip -r ./strimzi-$(RELEASE_VERSION).zip strimzi-$(RELEASE_VERSION)/
rm -rf ./strimzi-$(RELEASE_VERSION)
$(SUBDIRS):
$(MAKE) -C $@ $(MAKECMDGOALS)
.PHONY: all $(SUBDIRS) $(DOCKER_TARGETS)