mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-11-21 03:28:46 +00:00
feat: Add database migration steps to CI and deployment workflows
- Add migration execution step in CI workflow before linter runs - Configure DATABASE_URL environment variable for test database connection - Add placeholder migration steps in deploy workflow for staging and production environments - Include commented kubectl exec commands for future implementation in Kubernetes deployments
This commit is contained in:
@@ -40,6 +40,12 @@ jobs:
|
|||||||
working-directory: apps/api-server
|
working-directory: apps/api-server
|
||||||
run: go mod download
|
run: go mod download
|
||||||
|
|
||||||
|
- 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
|
||||||
|
|
||||||
- name: Run linter
|
- name: Run linter
|
||||||
working-directory: apps/api-server
|
working-directory: apps/api-server
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -170,6 +170,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: 'latest'
|
version: '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
|
||||||
|
echo "Staging migrations complete"
|
||||||
|
|
||||||
- name: Deploy to staging cluster
|
- name: Deploy to staging cluster
|
||||||
run: |
|
run: |
|
||||||
echo "Deploying to staging..."
|
echo "Deploying to staging..."
|
||||||
@@ -191,6 +197,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
version: 'latest'
|
version: '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
|
||||||
|
echo "Production migrations complete"
|
||||||
|
|
||||||
- name: Deploy to production cluster
|
- name: Deploy to production cluster
|
||||||
run: |
|
run: |
|
||||||
echo "Deploying to production..."
|
echo "Deploying to production..."
|
||||||
|
|||||||
Reference in New Issue
Block a user