Skip to content

Commit

Permalink
feat: add quick-migrate justfile command
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiin committed Sep 30, 2023
1 parent 06f350d commit dc55112
Show file tree
Hide file tree
Showing 3 changed files with 168 additions and 177 deletions.
21 changes: 9 additions & 12 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ default:
makemigration env="dev":
NODE_ENV={{env}} npm run orm migration:create


# run migration
migrate env="dev":
NODE_ENV={{env}} npm run orm migration:up
Expand All @@ -15,6 +16,10 @@ migrate env="dev":
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
Expand All @@ -25,7 +30,7 @@ test-e2e env="dev":


# clean all auto generated files and generate initial migration file
init: clean-files makemigration
init: clean-files build makemigration

# clean all auto generated files and run migration
clean-db: unmigrate migrate seed
Expand All @@ -49,18 +54,10 @@ build:
encryption:
sh scripts/encryption.sh

# run in shell mode
shell env="dev":
REPL=true npm run start:dev
# run in repl mode
repl env="dev":
REPL=true npm run start:repl

# 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
16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@
"@golevelup/nestjs-rabbitmq": "^4.0.0",
"@golevelup/nestjs-stripe": "^0.6.3",
"@golevelup/nestjs-webhooks": "^0.2.16",
"@mikro-orm/core": "^5.8.4",
"@mikro-orm/migrations": "^5.8.4",
"@mikro-orm/core": "^5.8.5",
"@mikro-orm/migrations": "^5.8.5",
"@mikro-orm/nestjs": "^5.2.2",
"@mikro-orm/postgresql": "^5.8.4",
"@mikro-orm/reflection": "^5.8.4",
"@mikro-orm/postgresql": "^5.8.5",
"@mikro-orm/reflection": "^5.8.5",
"@mikro-orm/sql-highlighter": "^1.0.1",
"@nestjs/axios": "^3.0.0",
"@nestjs/cache-manager": "^2.1.0",
Expand Down Expand Up @@ -141,12 +141,12 @@
"@firebase/app-compat": "^0.2.19",
"@firebase/app-types": "^0.9.0",
"@golevelup/ts-jest": "^0.4.0",
"@mikro-orm/cli": "^5.8.4",
"@mikro-orm/seeder": "^5.8.4",
"@mikro-orm/cli": "^5.8.5",
"@mikro-orm/seeder": "^5.8.5",
"@nestjs/cli": "10.1.18",
"@nestjs/schematics": "10.0.2",
"@nestjs/testing": "10.2.6",
"@rubiin/eslint-config": "^1.8.4",
"@rubiin/eslint-config": "^1.8.6-beta.2",
"@rubiin/tsconfig": "^1.1.0",
"@sentry/types": "^7.72.0",
"@side/jest-runtime": "^1.1.0",
Expand All @@ -159,7 +159,7 @@
"@types/jest": "^29.5.5",
"@types/mime-types": "^2.1.2",
"@types/multer": "^1.4.8",
"@types/node": "^20.7.1",
"@types/node": "^20.8.0",
"@types/nodemailer": "^6.4.11",
"@types/passport": "^1.0.13",
"@types/passport-facebook": "^3.0.1",
Expand Down
Loading

0 comments on commit dc55112

Please sign in to comment.