-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
124 lines (90 loc) · 2.83 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
BASE=docker compose -f docker-compose.yaml
PROD=$(BASE) -f docker-compose.prod.yaml --env-file .env.prod
LOCAL=$(BASE) -f docker-compose.local.yaml --env-file .env.local
DEV=$(LOCAL) -f docker-compose.local.dev.yaml
## Database (Jena Fuseki)
start-db:
$(LOCAL) up -d fuseki
start-db-prod:
$(PROD) up -d fuseki
stop-db:
$(LOCAL) stop fuseki
## Middleware
build-middleware:
$(LOCAL) build middleware
start-middleware:
$(LOCAL) up -d --force-recreate middleware
start-middleware-dev:
$(DEV) up -d --force-recreate middleware
start-middleware-prod:
$(PROD) up -d --force-recreate middleware
stop-middleware:
$(LOCAL) stop middleware
publish-middleware:
@echo "Which version?" && \
read version && \
docker tag transiscope-nantes/middleware registry.gitlab.com/transiscope-nantes/deploy-archipelago-nantes/middleware && \
docker tag transiscope-nantes/middleware registry.gitlab.com/transiscope-nantes/deploy-archipelago-nantes/middleware:$$version && \
docker push registry.gitlab.com/transiscope-nantes/deploy-archipelago-nantes/middleware && \
docker push registry.gitlab.com/transiscope-nantes/deploy-archipelago-nantes/middleware:$$version
## Frontend
build-frontend:
$(LOCAL) build frontend
build-frontend-dev:
$(DEV) build frontend
start-frontend:
$(LOCAL) up -d --force-recreate frontend
start-frontend-dev:
$(DEV) up -d --force-recreate frontend
start-frontend-prod:
$(PROD) up -d --force-recreate frontend
stop-frontend:
$(LOCAL) stop frontend
publish-frontend:
@echo "Which version?" && \
read version && \
docker tag transiscope-nantes/frontend registry.gitlab.com/transiscope-nantes/deploy-archipelago-nantes/frontend && \
docker tag transiscope-nantes/frontend registry.gitlab.com/transiscope-nantes/deploy-archipelago-nantes/frontend:$$version && \
docker push registry.gitlab.com/transiscope-nantes/deploy-archipelago-nantes/frontend && \
docker push registry.gitlab.com/transiscope-nantes/deploy-archipelago-nantes/frontend:$$version
## Global start/stop
start-local:
$(LOCAL) up -d
start-dev:
$(DEV) up -d --force-recreate
start-prod:
$(PROD) up -d
stop:
$(LOCAL) down
$(DEV) down
build: build-frontend build-middleware
## Logs
logs:
$(LOCAL) logs -f
## Other
update-prod:
make stop-middleware stop-frontend start-middleware-prod start-frontend-prod
set-compact-cron:
(crontab -l 2>/dev/null; echo "0 4 * * * ./compact-cron.sh >> /tmp/cronlog.txt") | crontab -
compact-prod:
make stop
$(PROD) up fuseki_compact
make start-prod
prune-data:
sudo rm -rf ./data
## Development
dev-init:
. ./dev.sh && init
dev-update:
. ./dev.sh && update
dev-sync:
. ./dev.sh && sync
dev-start-db:
cd dev && docker-compose up -d fuseki
dev-stop-db:
cd dev && docker-compose stop
dev-start-frontend:
. ./.env.local && . ./env.sh dev/frontend/public
cd dev/frontend && yarn dev
dev-start-middleware:
cd dev/middleware && yarn dev