-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
44 lines (33 loc) · 908 Bytes
/
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
STACK_NAME := $(shell basename "$$(pwd)")
DOMAINNAME := func-dms-prereq.communitygrid.dallasmakerspace.org
VIRTUAL_HOST := $(STACK_NAME).$(DOMAINNAME)
IMAGE_NAME := func-dms-prereq
PORT := 5000
NETWORK_NAME := public
export PORT
export VIRTUAL_HOST
export DOMAINNAME
export STACK_NAME
export IMAGE_NAME
export NETWORK_NAME
.SILENT:
.DEFAULT: all
.PHONY: all clean deploy test $(VIRTUAL_HOST)
all: clean deploy
clean:
@docker stack rm $(STACK_NAME)
distclean: clean
@docker volume ls | awk '/$(STACK_NAME)/ { system("docker volume rm "$$2) }'
@docker image rm $(IMAGE_NAME)
deploy: image networks volumes config secrets
@docker stack deploy -c docker-compose.yml $(STACK_NAME)
image:
@docker image build -t $(IMAGE_NAME) .
test: $(VIRTUAL_HOST)
networks:
@-docker network create -d overlay --scope swarm $(NETWORK_NAME)
config: ;
secrets: ;
volumes: ;
$(VIRTUAL_HOST):
@curl -sSLk $@