diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1273d86..495e45b 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -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;" diff --git a/deployment/docker-compose.yaml b/deployment/docker-compose.yaml index e0bd594..2910a77 100644 --- a/deployment/docker-compose.yaml +++ b/deployment/docker-compose.yaml @@ -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: