-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
89 lines (70 loc) · 2.49 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
85
86
87
88
GH = https://github.com/orgs/cpan-testers
SRC_DIR = src
REPOS = cpantesters-schema cpantesters-backend cpantesters-web cpantesters-api
ENV = devel
.PHONY: src docker docker-base docker-schema docker-backend docker-web docker-api \
start stop compose connect data restart
src:
for REPO in $(REPOS); do \
git clone $(GH)/$$REPO $(SRC_DIR)/$$REPO; \
done
docker-base:
@echo "Building base image as cpantesters/base..."
@docker build . --tag cpantesters/base >build-base.log \
|| echo "ERR: Build failed. See build-base.log";
docker-schema: docker-base
@BUILD="schema"; \
REPO="cpantesters-$$BUILD"; \
TAG="cpantesters/$$BUILD"; \
echo "Building repo $$REPO as $$TAG..."; \
docker build $(SRC_DIR)/$$REPO --tag $$TAG >build-$$BUILD.log \
|| echo "ERR: Build failed. See build-$$BUILD.log";
docker-backend: docker-base docker-schema
@BUILD="backend"; \
REPO="cpantesters-$$BUILD"; \
TAG="cpantesters/$$BUILD"; \
echo "Building repo $$REPO as $$TAG..."; \
docker build $(SRC_DIR)/$$REPO --tag $$TAG >build-$$BUILD.log \
|| echo "ERR: Build failed. See build-$$BUILD.log";
docker-web: docker-base docker-schema
@BUILD="web"; \
REPO="cpantesters-$$BUILD"; \
TAG="cpantesters/$$BUILD"; \
echo "Building repo $$REPO as $$TAG..."; \
docker build $(SRC_DIR)/$$REPO --tag $$TAG >build-$$BUILD.log \
|| echo "ERR: Build failed. See build-$$BUILD.log";
docker-api: docker-base docker-schema
@BUILD="api"; \
REPO="cpantesters-$$BUILD"; \
TAG="cpantesters/$$BUILD"; \
echo "Building repo $$REPO as $$TAG..."; \
docker build $(SRC_DIR)/$$REPO --tag $$TAG >build-$$BUILD.log \
|| echo "ERR: Build failed. See build-$$BUILD.log";
docker: docker-backend docker-web docker-api
compose: docker
@echo 'Refreshing docker-compose services'
@docker-compose build
@docker-compose up --no-start
start:
@docker-compose start
stop:
@docker-compose stop
restart:
@docker-compose stop
@docker-compose start
connect:
@docker-compose exec db_tester mysql cpantesters
data:
@echo "Fetching data for $(DIST)"
@docker-compose run deploy cpantesters-schema fetch --dist $(DIST) report release
daemon:
@COMPOSE_FILE=docker-compose.yml:docker-compose.daemon.yml \
docker-compose build
@COMPOSE_FILE=docker-compose.yml:docker-compose.daemon.yml \
docker-compose up
build-cert:
@COMPOSE_FILE=docker-compose.yml:docker-compose.$(ENV).yml \
docker-compose run certbot
list-cert:
@COMPOSE_FILE=docker-compose.yml:docker-compose.$(ENV).yml \
docker-compose run certbot certificates