This repository was archived by the owner on Feb 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathMakefile.service
More file actions
51 lines (38 loc) · 1.33 KB
/
Makefile.service
File metadata and controls
51 lines (38 loc) · 1.33 KB
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
# ANL:waggle-license
# This file is part of the Waggle Platform. Please see the file
# LICENSE.waggle.txt for the legal details of the copyright and software
# license. For more details on the Waggle project, visit:
# http://www.wa8.gl
# ANL:waggle-license
BEEHIVE_DOCKER_NETWORK?=beehive
include ../beehive.conf
export $(shell sed 's/=.*//' ../beehive.conf)
usage:
@echo "make [build | deploy | snapshot | rollback]"
build:
@bash -c 'if [ -e ./Dockerfile ] ; then set -x ; docker build -t $(image) . ; set +x ; else echo no Dockerfile; fi'
# ifeq ($(wildcard ./Dockerfile), )
# docker build -t $(image) .
# else
# @echo "no Dockerfile"
# endif
rm:
-docker rm -f $(name) &> /dev/null || true
start:
docker start $(name)
stop:
docker stop $(name)
restart:
docker restart $(name)
startnetwork:
@test -n "$(BEEHIVE_DOCKER_NETWORK)" || bash -c 'echo "BEEHIVE_DOCKER_NETWORK not defined" ; exit 1'
$(eval COUNT := $(shell docker network ls -q -f name=$(BEEHIVE_DOCKER_NETWORK)$ | wc -l ))
@if [ ! $(COUNT) -eq 1 ] ; then set -x ; docker network create $(BEEHIVE_DOCKER_NETWORK) ; fi
test: image = waggle/$(name):testing
test: build
test: deploy
snapshot:
docker tag $(image) $(image):snapshot-`date +'%Y.%m.%d.%H.%M.%S'`
docker tag $(image) $(image):snapshot
rollback: image := $(image):snapshot
rollback: deploy