-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (45 loc) · 992 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
include vars.mk
IMAGE = kubikvest/xodos
CONTAINER = kubikvest_webhook
TAG = 1.0.2
PORT = -p 8301:80
DOCKER_RM = false
build:
@docker build -t $(IMAGE):$(TAG) .
buildfs:
@docker run --rm \
-v $(CURDIR)/runner:/runner \
-v $(CURDIR)/build:/build \
-v $(CURDIR)/src:/src \
imega/base-builder \
--packages=" \
nginx-lua \
lua5.1-cjson \
git \
curl \
make \
docker@v32 \
" \
-d="lua5.1 luarocks@community"
start:
@docker run -d --name $(CONTAINER) \
-v /root/.dockercfg:/root/.dockercfg \
-v /tmp:/tmp \
-v /var/run/docker.sock:/var/run/docker.sock \
-e WEBHOOK=$(KV_WEBHOOK) \
--restart=always \
$(PORT) $(IMAGE):$(TAG)
test: build start
@docker run --rm=$(DOCKER_RM) \
-v $(CURDIR)/tests:/data \
-w /data \
--link $(CONTAINER):service \
alpine \
sh -c 'apk add --update bash curl jq && ./test.sh service'
stop:
@-docker stop $(CONTAINER)
clean: stop
@-docker rm -fv $(CONTAINER)
destroy:
@-docker rmi $(IMAGE)
.PHONY: build