Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 0 additions & 121 deletions Makefile

This file was deleted.

48 changes: 25 additions & 23 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ tasks:
exit 1
fi

migrate:
deps: [check-env]
cmds:
- pnpm migrate

# ─────────────────────────────────────────────
# Helpers
# ─────────────────────────────────────────────

compose:
cmds:
- docker compose -f {{.FILE}} {{.CMD}}

# ─────────────────────────────────────────────
# Quality
# ─────────────────────────────────────────────
Expand All @@ -40,8 +53,9 @@ tasks:
cmds:
- task test-reset
- task test-up
- task test-migrate
- pnpm jest
- task migrate
- |
pnpm jest || (task test-down && exit 1)
- task test-down

# ─────────────────────────────────────────────
Expand All @@ -51,32 +65,28 @@ tasks:
dev-up:
cmds:
- echo "🚧 Subindo Postgres DEV"
- docker compose -f {{.DEV_COMPOSE}} up -d
- task compose FILE={{.DEV_COMPOSE}} CMD="up -d"

dev-stop:
cmds:
- echo "⏹️ Parando containers DEV"
- docker compose -f {{.DEV_COMPOSE}} stop
- task compose FILE={{.DEV_COMPOSE}} CMD="stop"

dev-start:
cmds:
- echo "▶️ Iniciando containers DEV"
- docker compose -f {{.DEV_COMPOSE}} start
- task compose FILE={{.DEV_COMPOSE}} CMD="start"

dev-down:
cmds:
- echo "⬇️ Removendo containers DEV (mantendo volumes)"
- docker compose -f {{.DEV_COMPOSE}} down
- task compose FILE={{.DEV_COMPOSE}} CMD="down"

dev-reset:
cmds:
- echo "💥 Resetando ambiente DEV (containers + volumes)"
- docker compose -f {{.DEV_COMPOSE}} down -v
- task compose FILE={{.DEV_COMPOSE}} CMD="down -v"

dev-migrate:
deps: [check-env]
cmds:
- npx ts-node src/infrastructure/scripts/migrate.ts

# ─────────────────────────────────────────────
# PROD
Expand All @@ -85,12 +95,8 @@ tasks:
prod-up:
cmds:
- echo "🚀 Subindo Postgres PROD"
- docker compose -f {{.PROD_COMPOSE}} up -d
- task compose FILE={{.PROD_COMPOSE}} CMD="up -d"

prod-migrate:
deps: [check-env]
cmds:
- npx ts-node src/infrastructure/scripts/migrate.ts

# ─────────────────────────────────────────────
# TEST
Expand All @@ -99,22 +105,18 @@ tasks:
test-up:
cmds:
- echo "🧪 Subindo Postgres TEST"
- docker compose -f {{.TEST_COMPOSE}} up -d --wait
- task compose FILE={{.TEST_COMPOSE}} CMD="up -d --wait"

test-down:
cmds:
- echo "⬇️ Removendo containers TEST (mantendo volumes)"
- docker compose -f {{.TEST_COMPOSE}} down
- task compose FILE={{.TEST_COMPOSE}} CMD="down"

test-reset:
cmds:
- echo "💥 Resetando ambiente TEST (containers + volumes)"
- docker compose -f {{.TEST_COMPOSE}} down -v
- task compose FILE={{.TEST_COMPOSE}} CMD="down -v"

test-migrate:
deps: [check-env]
cmds:
- npx ts-node src/infrastructure/scripts/migrate.ts

# ─────────────────────────────────────────────
# Utils
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@
"scripts": {
"build": "nest build",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"migrate": "ts-node src/infrastructure/scripts/migrate.ts",
"start": "nest start",
"start:dev": "nest start --watch",
"start:debug": "nest start --debug --watch",
"start:dev": "nest start --watch",
"start:prod": "node dist/main",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"test": "jest",
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"
"test:e2e": "jest --config ./test/jest-e2e.json",
"test:watch": "jest --watch"
},
"dependencies": {
"@nestjs/common": "^11.0.1",
Expand Down
Loading