-
-
Notifications
You must be signed in to change notification settings - Fork 46
/
justfile
58 lines (43 loc) · 1.1 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
# prints all available commands
default:
just --list
# 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
# one stop command to make migration and migrate it
quick-migrate: makemigration migrate
# 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}} npm run test:e2e
# clean all auto generated files and generate initial migration file
init: clean-files build makemigration
# clean all auto generated files
clean-files:
rm -rf temp
rm -rf ./migrations
rm -rf *.log
rm -rf *.db
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 repl mode
repl env="dev":
REPL=true npm run start:repl
# run deploy script
deploy:
sh scripts/deploy.sh