forked from ryuichi1208/poc-nginx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
84 lines (68 loc) · 2.11 KB
/
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#############################
# docker settings #
#############################
POC_VERSION := 1.0.0
DOCKER := $(shell which docker)
DOCKER_COMPOSE := $(shell which docker-compose)
#############################
# test-tool build settings #
#############################
INCDIR := -I /usr/local/include -I /usr/include
CFLAGS := -Wall -O2 $(INCDIR)
LDFLAGS := -L /usr/lib -L /usr/local/lib
CFLAGS := -g -MMD -MP -Wall -Wextra -Winit-self -Wno-missing-field-initializers
PWD := $(shell pwd)
SH_FILE := $(shell find . -name *.sh)
.PHONY: version
version:
@echo ${POC_VERSION}
@uname -a && id
.PHONY: list
list:
date ; ${DOCKER_COMPOSE} -h
date ; ${DOCKER_COMPOSE} ps
up:
date ; ${DOCKER_COMPOSE} up -d
down:
date ; ${DOCKER_COMPOSE} down
.PHONY: restart
restart: list down up update-cert
.PHONY: build
build: list
date ; ${DOCKER_COMPOSE} down --rmi all
date ; ${DOCKER_COMPOSE} up -d
rm -f tmp/server*
.PHONY: poc
poc:
echo "curl --tlsv1.2 -vskL poc-proxy.example.com/uri/_info | jq ."
date ; ${DOCKER_COMPOSE} exec poc bash
.PHONY: offload
offload:
date ; ${DOCKER_COMPOSE} exec offload bash
.PHONY: reload
reload:
date ; ${DOCKER_COMPOSE} exec offload nginx -t
date ; ${DOCKER_COMPOSE} exec offload nginx -s reload
.PHONY: update-cert
update-cert:
date ; ${DOCKER} container cp nginx.dev.com:/etc/ssl/certs/server.crt tmp
date ; ${DOCKER} container cp nginx.dev.com:/etc/ssl/certs/server_wild.crt tmp
date ; ${DOCKER} container cp tmp/server.crt poc:/usr/local/share/ca-certificates
date ; ${DOCKER} container cp tmp/server_wild.crt poc:/usr/local/share/ca-certificates
date ; ${DOCKER_COMPOSE} exec poc update-ca-certificates
# date ; ${DOCKER_COMPOSE} exec poc update-ca-trust
.PHONY: web01
web01:
date ; ${DOCKER_COMPOSE} exec webapp001 bash
.PHONY: web02
web02:
date ; ${DOCKER_COMPOSE} exec webapp002 bash
.PHONY: web03
web03:
date ; ${DOCKER_COMPOSE} exec webapp002 bash
.PHONY: test
test:
date ; ${DOCKER_COMPOSE} exec poc curl --tlsv1.2 -vskL poc-proxy.example.com/uri/
.PHONY: shellcheck
shellcheck:
cd script && docker container run -v ${PWD}/:/mnt koalaman/shellcheck ${SH_FILE} || echo 0