-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
executable file
·71 lines (57 loc) · 1.62 KB
/
Copy pathmakefile
File metadata and controls
executable file
·71 lines (57 loc) · 1.62 KB
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
NODE_VERSION := $(shell node -v 2>/dev/null)
REQUIRED_NODE := v18.20.8
# Check if Node.js is installed and if the version is correct. If not, exit with an error.
check-node:
@if [ -z "$(NODE_VERSION)" ]; then \
echo "Error: Node.js is not installed. Please install Node.js $(REQUIRED_NOTE)"; \
exit 1; \
elif [ "$(NODE_VERSION)" != "$(REQUIRED_NODE)" ]; then \
echo "Error: Wrong Node.js version. Please switch to $(REQUIRED_NODE) (current: $(NODE_VERSION))"; \
echo "Run: nvm use lts/hydrogen"; \
exit 1; \
fi
# Install dependencies.
init: check-node
yarn install
# Clean the cache and public directory.
clean:
rm -rf .cache || true
rm -rf public || true
yarn run clean
# Clean the cache and public directory for development.
clean-dev: check-node
make clean || true
make dev
# Run the development server.
dev: check-node
yarn run develop
# Run the development server for the mainnet.
dev-m: check-node
yarn run develop-net
# Clean the cache and public directory for development for the mainnet.
clean-dev-m: check-node
make clean || true
make dev-m
# Format the code.
format: check-node
yarn run format
# Build the project.
build: check-node
yarn run build
# Serve the project.
serve: check-node
yarn run serve
# Serve the project for the mainnet.
serve-m: check-node
yarn run serve-net
# Build and run the project in a Docker container.
docker-buildup: check-node
docker-compose build || true
docker-compose up
# Run the project in a Docker container.
docker-up: check-node
docker-compose up
# Deploy the project to the live server.
# deploy-live:
# git pull upstream master || true
# git push origin master