Refactor database update job and update connection string in docker-compose for consistency #5
This commit is contained in:
@@ -43,18 +43,6 @@ semantic-release:
|
||||
only:
|
||||
- main
|
||||
|
||||
update_db:
|
||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||
stage: release
|
||||
script:
|
||||
- dotnet restore
|
||||
- dotnet build
|
||||
- dotnet ef database update --project Api/Api.csproj --startup-project Api/Api.csproj
|
||||
variables:
|
||||
ConnectionStrings__DefaultConnection: "Server=db;Database=CentrumDb;User=sa;Password=Your_password123;TrustServerCertificate=True;"
|
||||
only:
|
||||
- main
|
||||
|
||||
docker-build:
|
||||
stage: build
|
||||
image: docker:latest
|
||||
@@ -85,3 +73,15 @@ docker-deploy:
|
||||
- docker compose pull
|
||||
- docker compose -f docker-compose.yaml up -d
|
||||
- docker image prune -f -a
|
||||
|
||||
update_db:
|
||||
image: mcr.microsoft.com/dotnet/sdk:8.0
|
||||
stage: release
|
||||
script:
|
||||
- dotnet restore
|
||||
- dotnet build
|
||||
- dotnet ef database update --project Api/Api.csproj --startup-project Api/Api.csproj
|
||||
tags:
|
||||
- production
|
||||
variables:
|
||||
ConnectionStrings__DefaultConnection: "Server=localhost;Database=CentrumDb;User=sa;Password=$DB_PASSWORD;TrustServerCertificate=True;"
|
||||
|
||||
@@ -8,7 +8,7 @@ services:
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Production
|
||||
- ConnectionStrings__DefaultConnection=Server=localhost;Database=centrum;User Id=sa;Password=$DB_PASSWORD;TrustServerCertificate=True;
|
||||
- ConnectionStrings__DefaultConnection=Server=localhost;Database=CentrumDb;User Id=sa;Password=$DB_PASSWORD;TrustServerCertificate=True;
|
||||
network_mode: host
|
||||
|
||||
db:
|
||||
|
||||
Reference in New Issue
Block a user