-
Notifications
You must be signed in to change notification settings - Fork 66
/
Makefile
65 lines (60 loc) · 2.58 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
53
54
55
56
57
58
59
60
61
62
63
64
65
#
# Makefile for building storm docker images
#
# make help
#
#
RELEASE ?= `grep -1 -A 0 -B 0 '<version>' pom.xml | head -n 1 | awk '{print $1}' | sed -e 's/.*<version>//' | sed -e 's/<\/version>.*//'`
DOCKER_REPO ?= mesos/storm
MIRROR ?=
STORM_URL ?=
JAVA_PRODUCT_VERSION ?= 7
all: help
help:
@echo 'Options available:'
@echo ' make images STORM_RELEASE=0.10.1 MESOS_RELEASE=0.28.2 DOCKER_REPO=mesos/storm'
@echo ' make push STORM_RELEASE=0.10.1 MESOS_RELEASE=0.28.2 DOCKER_REPO=mesos/storm'
@echo ''
@echo 'ENV'
@echo ' STORM_RELEASE The targeted release version of Storm'
@echo ' Default: 0.10.1'
@echo ' MESOS_RELEASE The targeted release version of MESOS'
@echo ' Default: 0.28.2'
@echo ' DOCKER_REPO The docker repo for which to build the docker image'
@echo ' Default: mesos/storm'
@echo ' RELEASE The targeted release version of Storm'
@echo ' Default: current version in pom.xml'
@echo ' JAVA_PRODUCT_VERSION The java product version to use in the docker image'
@echo ' Default: 7'
@echo ' MIRROR Where to download the apache storm packages'
@echo ' Default: http://www.gtlib.gatech.edu/pub'
@echo ' STORM_URL The url to use to download the apache storm packages'
@echo ' Default: $$MIRROR/apache/storm/apache-storm-$$STORM_RELEASE/apache-storm-$$STORM_RELEASE.tar.gz'
check-version:
ifndef STORM_RELEASE
@echo "Error: STORM_RELEASE is undefined."
@make --no-print-directory help
@exit 1
endif
ifndef MESOS_RELEASE
@echo "Error: MESOS_RELEASE is undefined."
@make --no-print-directory help
@exit 1
endif
images: check-version
docker build \
--rm \
--build-arg STORM_RELEASE=$(STORM_RELEASE) \
--build-arg MESOS_RELEASE=$(MESOS_RELEASE) \
--build-arg RELEASE=$(RELEASE) \
--build-arg JAVA_PRODUCT_VERSION=$(JAVA_PRODUCT_VERSION) \
--build-arg MIRROR=$(MIRROR) \
--build-arg STORM_URL=$(STORM_URL) \
-t $(DOCKER_REPO):$(RELEASE)-$(STORM_RELEASE)-$(MESOS_RELEASE)-jdk$(JAVA_PRODUCT_VERSION) .
docker build \
--rm \
-f onbuild/Dockerfile \
-t $(DOCKER_REPO):$(RELEASE)-$(STORM_RELEASE)-$(MESOS_RELEASE)-jdk$(JAVA_PRODUCT_VERSION)-onbuild .
push: check-version
docker push $(DOCKER_REPO):$(RELEASE)-$(STORM_RELEASE)-$(MESOS_RELEASE)-jdk$(JAVA_PRODUCT_VERSION)
docker push $(DOCKER_REPO):$(RELEASE)-$(STORM_RELEASE)-$(MESOS_RELEASE)-jdk$(JAVA_PRODUCT_VERSION)-onbuild