forked from civitai/civitai
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (56 loc) · 1.43 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
# Start the containers in the background
.PHONY: start
start:
docker-compose up -d
# Stop all containers
.PHONY: stop
stop:
docker-compose stop
# Remove containers
.PHONY: down
down:
docker-compose down
# Restart containers
.PHONY: restart
restart: stop start
# Rebuild the containers
.PHONY: rebuild
rebuild:
docker-compose down \
&& docker-compose up --build -d
# Stop and remove all containers, networks, images, and volumes
.PHONY: burn
burn:
docker-compose down \
&& docker-compose down --volumes
# Initialize the database and seed it with data
.PHONY: bootstrap-db
bootstrap-db:
npx cross-env NODE_ENV=development tsx ./scripts/local-dev/gen_seed.ts
# Run new migrations
.PHONY: run-migrations
run-migrations:
npx cross-env NODE_ENV=development tsx ./scripts/local-dev/run_migrations.ts
# Trigger metrics and search data jobs
.PHONY: bootstrap-metrics
bootstrap-metrics:
npx cross-env NODE_ENV=development tsx ./scripts/local-dev/bootstrap-metrics-search.ts
.PHONY: copy-env
copy-env:
cp -u ./.env-example ./.env.development
.PHONY: npm-install
npm-install:
npm i
.PHONY: run
run:
npm run db:generate
npm run dev
.PHONY: init
init: copy-env npm-install start run-migrations bootstrap-db bootstrap-metrics run
.PHONY: rerun
rerun: start bootstrap-db bootstrap-metrics
npm run dev
.PHONY: init-devcontainer
init-devcontainer: copy-env npm-install run-migrations bootstrap-db bootstrap-metrics
.PHONY: default
default: start