forked from rubiin/ultimate-nest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
justfile
72 lines (53 loc) · 1.41 KB
/
justfile
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
# prints all availabe commands
default:
just --list
# make initial migration file for the first time
makemigration-init env="dev":
NODE_ENV={{env}} npm run orm migration:create --initial
# make migration file for the current changes
makemigration env="dev":
NODE_ENV={{env}} npm run orm migration:create
# run migration
migrate env="dev":
NODE_ENV={{env}} npm run orm migration:up
# revert migration
unmigrate env="dev":
NODE_ENV={{env}} npm run orm migration:down
# run seeders to populate database
seed env="dev":
USER_PASSWORD=Test@1234 NODE_ENV={{env}} npm run orm seeder:run
# test e2e with jest
test-e2e env="dev":
USER_PASSWORD=Test@1234 NODE_ENV={{env}} yarn test:e2e
# clean all auto generated files and generate initial migration file
init: clean-files
makemigration-init
# clean all auto generated files and run migration
clean-db: unmigrate
migrate
seed
# clean all auto generated files
clean-files:
rm -rf temp
rm -rf ./migrations
rm -rf logs
rm -rf dist
rm -rf uploads
# build code
build:
nest build
# generate encryption key and iv
encryption:
sh scripts/encryption.sh
# run in shell mode
shell env="dev":
REPL=true npm run start:dev
# run deploy script
deploy:
sh scripts/deploy.sh
# stop deployed containers
stop env="dev":
ENV=dev docker compose -f docker-compose.{{env}}.yml stop
# remove deployed containers
remove env="dev":
ENV=dev docker compose -f docker-compose.{{env}}.yml down