refactor: Replace custom migration runner with goose CLI tool in CI and deployment workflows

- Install goose CLI tool using go install in CI and deploy workflows
- Replace custom migration command (go run cmd/migrate/main.go --action=up) with goose postgres command
- Remove working-directory specification from CI migration step
- Update commented kubectl exec commands in deploy workflow to use goose instead of custom runner
- Simplify migration execution by using standardized goose tool across all environments
This commit is contained in:
nutcas3
2026-04-29 02:54:08 +03:00
parent 6fd5d89671
commit 87dd487d48
2 changed files with 12 additions and 4 deletions
+4 -2
View File
@@ -40,11 +40,13 @@ jobs:
working-directory: apps/api-server
run: go mod download
- name: Install goose
run: go install github.com/pressly/goose/v3/cmd/goose@latest
- name: Run database migrations
working-directory: apps/api-server
env:
DATABASE_URL: postgresql://test_user:test_password@localhost:5432/test_db?sslmode=disable
run: go run cmd/migrate/main.go --action=up
run: goose postgres $DATABASE_URL up migrations
- name: Run linter
working-directory: apps/api-server
+8 -2
View File
@@ -170,10 +170,13 @@ jobs:
with:
version: 'latest'
- name: Install goose
run: go install github.com/pressly/goose/v3/cmd/goose@latest
- name: Run database migrations
run: |
echo "Running database migrations for staging..."
# kubectl exec -it deployment/api-server -- go run cmd/migrate/main.go --action=up
# goose postgres $DATABASE_URL up migrations
echo "Staging migrations complete"
- name: Deploy to staging cluster
@@ -197,10 +200,13 @@ jobs:
with:
version: 'latest'
- name: Install goose
run: go install github.com/pressly/goose/v3/cmd/goose@latest
- name: Run database migrations
run: |
echo "Running database migrations for production..."
# kubectl exec -it deployment/api-server -- go run cmd/migrate/main.go --action=up
# goose postgres $DATABASE_URL up migrations
echo "Production migrations complete"
- name: Deploy to production cluster