-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
61 lines (39 loc) · 915 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# https://gist.github.com/coolcow/213653bef387855349593dcd16923637
include make.env
IMAGE_NAME = $(NAMESPACE)/$(NAME)
# ---
default: update-dependencies build
# ---
update-dependencies:
@for dependency in $(DEPENDENCIES); do \
docker pull $$dependency; \
done
# ---
build:
@ \
IMAGE_NAME=$(IMAGE_NAME) \
VCS_REF=`git rev-parse --short HEAD` \
BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"` \
hooks/build \
.
# ---
inspect:
@docker inspect $(IMAGE_NAME):$(VERSION)
# ---
run:
@docker run --rm $(IMAGE_NAME):$(VERSION) $(ENVIRONMENTS) $(VOLUMES)
# ---
start:
@docker run -d --name $(NAME)-$(INSTANCE) $(ENVIRONMENTS) $(VOLUMES) $(IMAGE_NAME):$(VERSION)
# ---
stop:
@docker rm -f $(NAME)-$(INSTANCE)
# ---
exec:
docker exec -it $(NAME)-$(INSTANCE) /bin/sh
# ---
shell:
@docker run --rm -it $(IMAGE_NAME):$(VERSION) /bin/sh
# ---
release:
@docker push $(IMAGE_NAME):$(VERSION)