mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-30 00:22:15 +00:00
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:
@@ -40,11 +40,13 @@ jobs:
|
|||||||
working-directory: apps/api-server
|
working-directory: apps/api-server
|
||||||
run: go mod download
|
run: go mod download
|
||||||
|
|
||||||
|
- name: Install goose
|
||||||
|
run: go install github.com/pressly/goose/v3/cmd/goose@latest
|
||||||
|
|
||||||
- name: Run database migrations
|
- name: Run database migrations
|
||||||
working-directory: apps/api-server
|
|
||||||
env:
|
env:
|
||||||
DATABASE_URL: postgresql://test_user:test_password@localhost:5432/test_db?sslmode=disable
|
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
|
- name: Run linter
|
||||||
working-directory: apps/api-server
|
working-directory: apps/api-server
|
||||||
|
|||||||
@@ -170,10 +170,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: 'latest'
|
version: 'latest'
|
||||||
|
|
||||||
|
- name: Install goose
|
||||||
|
run: go install github.com/pressly/goose/v3/cmd/goose@latest
|
||||||
|
|
||||||
- name: Run database migrations
|
- name: Run database migrations
|
||||||
run: |
|
run: |
|
||||||
echo "Running database migrations for staging..."
|
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"
|
echo "Staging migrations complete"
|
||||||
|
|
||||||
- name: Deploy to staging cluster
|
- name: Deploy to staging cluster
|
||||||
@@ -197,10 +200,13 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: 'latest'
|
version: 'latest'
|
||||||
|
|
||||||
|
- name: Install goose
|
||||||
|
run: go install github.com/pressly/goose/v3/cmd/goose@latest
|
||||||
|
|
||||||
- name: Run database migrations
|
- name: Run database migrations
|
||||||
run: |
|
run: |
|
||||||
echo "Running database migrations for production..."
|
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"
|
echo "Production migrations complete"
|
||||||
|
|
||||||
- name: Deploy to production cluster
|
- name: Deploy to production cluster
|
||||||
|
|||||||
Reference in New Issue
Block a user