-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (40 loc) · 1.19 KB
/
Makefile
File metadata and controls
50 lines (40 loc) · 1.19 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
DOCKER_RM = false
TAG = 1.1.0
build: buildfs
@docker build -t imega/nginx-stub:$(TAG) .
buildfs:
@docker run --rm=$(DOCKER_RM) \
-v $(CURDIR)/runner:/runner \
-v $(CURDIR)/build:/build \
-v $(CURDIR)/src:/src \
imega/base-builder \
--packages="nginx-lua@v34"
containers/nginx_stub:
@mkdir -p $(CURDIR)/$(shell dirname $@)
@docker run -d --name nginx_stub $(APPDIR) -v $(CURDIR)/data:/data imega/nginx-stub:$(TAG)
@touch $@
get_containers:
$(eval CONTAINERS := $(subst containers/,,$(shell find containers -type f)))
stop: get_containers
@-docker stop $(CONTAINERS)
clean: stop
@-docker rm -fv $(CONTAINERS)
@-rm -rf containers/*
logdir:
@mkdir -p $(CURDIR)/src/app/logs
@touch $(CURDIR)/src/app/logs/error.log
start: APPDIR = -v $(CURDIR)/src/app:/app
start: logdir containers/nginx_stub
test: build containers/nginx_stub
@mkdir -p $(CURDIR)/data
@docker run --rm=$(DOCKER_RM) \
-v $(CURDIR)/tests:/tests \
-v $(CURDIR)/data:/data \
-w /tests \
--link nginx_stub:server \
alpine \
sh -c 'apk add --update bash curl && ./test.sh server'
release:
docker tag imega/nginx-stub:$(TAG) imega/nginx-stub:latest
docker push imega/nginx-stub:$(TAG)
docker push imega/nginx-stub:latest