-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
49 lines (39 loc) · 1.35 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
.PHONY: build
build: .env desci-contracts/.env
$(MAKE) -C desci-models build
$(MAKE) -C desci-contracts build
$(MAKE) -C desci-server install
$(MAKE) -C desci-repo install
$(MAKE) -C sync-server install
$(MAKE) -C nodes-lib build
.PHONY: sterile
sterile: clean-rec
# Remove containers and volumes
docker compose -p desci down --volumes
sudo rm -rf local-data
.PHONY: clean
clean: clean-rec
rm -rf local-data/ganache
./resetTables.sh
# Down stops and removes containers
docker compose -p desci down
.PHONY: clean-rec
clean-rec:
$(MAKE) -C desci-contracts clean
$(MAKE) -C desci-models clean
$(MAKE) -C desci-server clean
$(MAKE) -C desci-repo clean
.PHONY: .env
.env: nodes-media/.env desci-repo/.env
# Phony target, always runs but is idempotent
# Copies example env if not present, and fails until MNEMONIC is set
if [ ! -f .env ]; then cp .env.example .env; fi
if ! grep -q MNEMONIC .env; then echo "ERROR: set MNEMONIC in .env"; exit 1; fi
desci-contracts/.env: .env
grep "MNEMONIC" .env > desci-contracts/.env
nodes-media/.env:
if [ ! -f nodes-media/.env ]; then cp nodes-media/.env.example nodes-media/.env; fi
desci-repo/.env:
if [ ! -f desci-repo/.env ]; then cp desci-repo/.env.example desci-repo/.env; fi
desci-media-isolated/.env:
if [ ! -f desci-media-isolated/.env ]; then cp desci-media-isolated/.env.example desci-media-isolated/.env; fi