This repository was archived by the owner on Mar 22, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathMakefile
53 lines (40 loc) · 1.42 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
export NS3_TAG ?= 3.33
export SUMO_TAG ?= 1.4.0
COHYDRA_TAG ?= $(shell if [ -z "`git status --porcelain`" ]; then git rev-parse --short HEAD; else echo dirty; fi)
export COHYDRA_TAG := ${COHYDRA_TAG}
docker_build := docker build --build-arg NS3_TAG --build-arg SUMO_TAG --build-arg COHYDRA_TAG
.PHONY: latest cohydra-base cohydra cohydra-dev docs
all: cohydra-base cohydra cohydra-dev
#
# build tag ${COHYDRA_TAG}
#
git-is-clean:
ifeq '${shell git status --porcelain}' ''
@ # git is clean
else
${error Git status is not clean.}
endif
latest:
docker tag osmhpi/cohydra:base-${COHYDRA_TAG} osmhpi/cohydra:base || true
docker tag osmhpi/cohydra:${COHYDRA_TAG} osmhpi/cohydra:latest || true
docker tag osmhpi/cohydra:dev-${COHYDRA_TAG} osmhpi/cohydra:dev || true
cohydra-base:
${docker_build} -t osmhpi/cohydra:base-${COHYDRA_TAG} docker/cohydra-base
cohydra:
${docker_build} -t osmhpi/cohydra:${COHYDRA_TAG} . -f docker/Dockerfile
cohydra-dev:
${docker_build} -t osmhpi/cohydra:dev-${COHYDRA_TAG} docker/cohydra-dev
pull-latest:
docker pull osmhpi/cohydra:base
docker pull osmhpi/cohydra:latest
docker pull osmhpi/cohydra:dev
push:
docker push osmhpi/cohydra:base-${COHYDRA_TAG}
docker push osmhpi/cohydra:${COHYDRA_TAG}
docker push osmhpi/cohydra:dev-${COHYDRA_TAG}
push-latest: git-is-clean push
docker push osmhpi/cohydra:base
docker push osmhpi/cohydra:latest
docker push osmhpi/cohydra:dev
docs:
$(MAKE) -C docs