-
Notifications
You must be signed in to change notification settings - Fork 48
/
Makefile
50 lines (42 loc) · 1.21 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
.PHONY: build-replacements replacements build-server install-server push-server pull-server run-server
PLAYGROUND_IMG:=cartesi/playground
REPLACEMENTS_IMG:=cartesi/docs-replacements
SERVER_IMG:=cartesi/docs-server
build-replacements:
docker build -t $(REPLACEMENTS_IMG) replacements
replacements: build-replacements
touch replacements.json
docker run \
-e USER=$$(id -u -n) \
-e GROUP=$$(id -g -n) \
-e UID=$$(id -u) \
-e GID=$$(id -g) \
-v `pwd`:/home/$$(id -u -n) \
-w /home/$$(id -u -n) \
--rm $(REPLACEMENTS_IMG) node /opt/cartesi/docs-replacements/replacements.js /home/$$(id -u -n)/docs $$REPLACEMENTS_FILTER
build-server:
docker build -t $(SERVER_IMG) server
install-server: build-server
docker run \
-e USER=$$(id -u -n) \
-e GROUP=$$(id -g -n) \
-e UID=$$(id -u) \
-e GID=$$(id -g) \
-v `pwd`:/outside \
-w /outside \
--rm $(SERVER_IMG) yarn install --non-interactive
push-server: build-server
docker push $(SERVER_IMG)
pull-server:
docker pull $(SERVER_IMG)
run-server:
docker run \
-e USER=$$(id -u -n) \
-e GROUP=$$(id -g -n) \
-e UID=$$(id -u) \
-e GID=$$(id -g) \
-v `pwd`:/outside \
-w /outside \
-p 3000:3000 \
-it \
--rm $(SERVER_IMG)