-
Notifications
You must be signed in to change notification settings - Fork 29
/
Makefile
54 lines (42 loc) · 1.31 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
.PHONY: builder builder.build builder.create builder.start
PROJECT ?= test
VOLUMES ?= $(shell pwd)/examples
BUILDS ?= ${VOLUMES}/builds
BUILDER ?= ${PROJECT}-builder
BUILDER_IMAGE ?= mongooseim/mongooseim-builder:latest
MEMBER ?= ${PROJECT}-mongooseim
MEMBER_BASE ?= ${PROJECT}-mongooseim
# Public
#
builder: builder.start
builder.destroy:
-docker stop ${BUILDER}
-docker rm ${BUILDER}
builder.build:
docker build -f Dockerfile.builder -t ${BUILDER} .
builder.create:
docker create --name ${BUILDER} -h ${BUILDER} \
-v ${VOLUMES}/builds:/builds ${BUILDER_IMAGE}
builder.start:
docker start ${BUILDER}
builder.shell:
docker exec -it ${BUILDER} bash
# MEMBER here is like test-mongooseim, i.e. no numeric suffix
member.build:
cp ${BUILDS}/${MEMBER_TGZ} member/mongooseim.tar.gz
docker build -f Dockerfile.member -t ${MEMBER_BASE} .
# TODO: temporary
# MEMBER here is like test-mongooseim-1, test-mongooseim-2, ...
member.create:
-mkdir -p ${VOLUMES}/${MEMBER}
-rm -rf ${VOLUMES}/${MEMBER}/mongooseim/Mnesia*
docker create --name ${MEMBER} -h ${MEMBER} -P -t \
-v ${VOLUMES}/${MEMBER}:/member \
${MEMBER_BASE}
docker start ${MEMBER}
member.start:
docker start ${MEMBER}
# MEMBER here is like test-mongooseim-1, test-mongooseim-2, ...
member.destroy:
-docker stop ${MEMBER}
-docker rm ${MEMBER}