Skip to content

Commit

Permalink
rename background projects
Browse files Browse the repository at this point in the history
  • Loading branch information
phongnguyend committed Oct 25, 2024
1 parent fce9b5d commit 10d927a
Show file tree
Hide file tree
Showing 65 changed files with 137 additions and 138 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/.net-build-modularmonolith.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,20 @@ jobs:
- name: Build
run: dotnet build --configuration Release

- name: Publish ClassifiedAds.BackgroundServer
run: dotnet publish ClassifiedAds.BackgroundServer/*.csproj --configuration Release
- name: Publish ClassifiedAds.Background
run: dotnet publish ClassifiedAds.Background/*.csproj --configuration Release

- name: Publish ClassifiedAds.Migrator
run: dotnet publish ClassifiedAds.Migrator/*.csproj --configuration Release

- name: Publish ClassifiedAds.WebAPI
run: dotnet publish ClassifiedAds.WebAPI/*.csproj --configuration Release

- name: Upload ClassifiedAds.BackgroundServer
- name: Upload ClassifiedAds.Background
uses: actions/upload-artifact@v4
with:
name: ClassifiedAds.BackgroundServer
path: src/ModularMonolith/ClassifiedAds.BackgroundServer/bin/Release/net8.0/publish
name: ClassifiedAds.Background
path: src/ModularMonolith/ClassifiedAds.Background/bin/Release/net8.0/publish

- name: Upload ClassifiedAds.Migrator
uses: actions/upload-artifact@v4
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/.net-build-monolith.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ jobs:
- name: Build
run: dotnet build --configuration Release

- name: Publish ClassifiedAds.BackgroundServer
run: dotnet publish ClassifiedAds.BackgroundServer/*.csproj --configuration Release
- name: Publish ClassifiedAds.Background
run: dotnet publish ClassifiedAds.Background/*.csproj --configuration Release

- name: Publish ClassifiedAds.GraphQL
run: dotnet publish ClassifiedAds.GraphQL/*.csproj --configuration Release
Expand All @@ -51,11 +51,11 @@ jobs:
- name: Publish ClassifiedAds.BlazorWebAssembly
run: dotnet publish ClassifiedAds.BlazorWebAssembly/*.csproj --configuration Release

- name: Upload ClassifiedAds.BackgroundServer
- name: Upload ClassifiedAds.Background
uses: actions/upload-artifact@v4
with:
name: ClassifiedAds.BackgroundServer
path: src/Monolith/ClassifiedAds.BackgroundServer/bin/Release/net8.0/publish
name: ClassifiedAds.Background
path: src/Monolith/ClassifiedAds.Background/bin/Release/net8.0/publish

- name: Upload ClassifiedAds.GraphQL
uses: actions/upload-artifact@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker-build-modularmonolith.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ jobs:
echo VERSION=$VERSION
docker tag classifiedads.modularmonolith.backgroundserver $REPO_NAME/classifiedads.modularmonolith.backgroundserver:$VERSION
docker tag classifiedads.modularmonolith.background $REPO_NAME/classifiedads.modularmonolith.background:$VERSION
docker tag classifiedads.modularmonolith.migrator $REPO_NAME/classifiedads.modularmonolith.migrator:$VERSION
docker tag classifiedads.modularmonolith.webapi $REPO_NAME/classifiedads.modularmonolith.webapi:$VERSION
docker tag classifiedads.modularmonolith.identityserver $REPO_NAME/classifiedads.modularmonolith.identityserver:$VERSION
docker push $REPO_NAME/classifiedads.modularmonolith.backgroundserver:$VERSION
docker push $REPO_NAME/classifiedads.modularmonolith.background:$VERSION
docker push $REPO_NAME/classifiedads.modularmonolith.migrator:$VERSION
docker push $REPO_NAME/classifiedads.modularmonolith.webapi:$VERSION
docker push $REPO_NAME/classifiedads.modularmonolith.identityserver:$VERSION
4 changes: 2 additions & 2 deletions .github/workflows/docker-build-monolith.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ jobs:
echo VERSION=$VERSION
docker tag classifiedads.backgroundserver $REPO_NAME/classifiedads.backgroundserver:$VERSION
docker tag classifiedads.background $REPO_NAME/classifiedads.background:$VERSION
docker tag classifiedads.migrator $REPO_NAME/classifiedads.migrator:$VERSION
docker tag classifiedads.webapi $REPO_NAME/classifiedads.webapi:$VERSION
docker tag classifiedads.graphql $REPO_NAME/classifiedads.graphql:$VERSION
docker tag classifiedads.blazor $REPO_NAME/classifiedads.blazor:$VERSION
docker tag classifiedads.identityserver $REPO_NAME/classifiedads.identityserver:$VERSION
docker tag classifiedads.webmvc $REPO_NAME/classifiedads.webmvc:$VERSION
docker push $REPO_NAME/classifiedads.backgroundserver:$VERSION
docker push $REPO_NAME/classifiedads.background:$VERSION
docker push $REPO_NAME/classifiedads.migrator:$VERSION
docker push $REPO_NAME/classifiedads.webapi:$VERSION
docker push $REPO_NAME/classifiedads.graphql:$VERSION
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v2
name: backgroundserver
name: background
version: 1.0.0
type: application
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: {{ .Release.Name}}-backgroundserver
name: {{ .Release.Name}}-backgroundserver
app: {{ .Release.Name}}-background
name: {{ .Release.Name}}-background
spec:
replicas: 1
selector:
matchLabels:
app: {{ .Release.Name}}-backgroundserver
app: {{ .Release.Name}}-background
strategy: {}
template:
metadata:
labels:
app: {{ .Release.Name}}-backgroundserver
app: {{ .Release.Name}}-background
spec:
containers:
- env:
Expand All @@ -24,8 +24,8 @@ spec:
envFrom:
- configMapRef:
name: {{ .Release.Name}}-shared
image: phongnguyend/classifiedads.modularmonolith.backgroundserver
name: {{ .Release.Name}}-backgroundserver
image: phongnguyend/classifiedads.modularmonolith.background
name: {{ .Release.Name}}-background
ports:
- containerPort: 80
resources: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ apiVersion: v1
kind: Service
metadata:
labels:
app: {{ .Release.Name}}-backgroundserver
name: {{ .Release.Name}}-backgroundserver
app: {{ .Release.Name}}-background
name: {{ .Release.Name}}-background
spec:
ports:
- name: "80"
port: 80
targetPort: 80
selector:
app: {{ .Release.Name}}-backgroundserver
app: {{ .Release.Name}}-background
status:
loadBalancer: {}
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: backgroundserver
name: backgroundserver
app: background
name: background
spec:
replicas: 1
selector:
matchLabels:
app: backgroundserver
app: background
strategy: {}
template:
metadata:
labels:
app: backgroundserver
app: background
spec:
containers:
- env:
Expand All @@ -24,8 +24,8 @@ spec:
envFrom:
- configMapRef:
name: shared
image: phongnguyend/classifiedads.modularmonolith.backgroundserver
name: backgroundserver
image: phongnguyend/classifiedads.modularmonolith.background
name: background
ports:
- containerPort: 80
resources: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ apiVersion: v1
kind: Service
metadata:
labels:
app: backgroundserver
name: backgroundserver
app: background
name: background
spec:
ports:
- name: "80"
port: 80
targetPort: 80
selector:
app: backgroundserver
app: background
status:
loadBalancer: {}
8 changes: 4 additions & 4 deletions src/ModularMonolith/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"version": "0.2.0",
"configurations": [
{
"name": "ClassifiedAds.BackgroundServer",
"name": "ClassifiedAds.Background",
"type": "coreclr",
"request": "launch",
//"preLaunchTask": "build",
"program": "${workspaceFolder}/ClassifiedAds.BackgroundServer/bin/Debug/net6.0/ClassifiedAds.BackgroundServer.dll",
"program": "${workspaceFolder}/ClassifiedAds.Background/bin/Debug/net6.0/ClassifiedAds.Background.dll",
"args": [],
"cwd": "${workspaceFolder}/ClassifiedAds.BackgroundServer",
"cwd": "${workspaceFolder}/ClassifiedAds.Background",
"stopAtEntry": false,
"console": "internalConsole",
"env": {
Expand Down Expand Up @@ -90,7 +90,7 @@
"compounds": [
{
"name": "ClassifiedAds.ModularMonolith",
"configurations": ["ClassifiedAds.BackgroundServer", "ClassifiedAds.Migrator", "ClassifiedAds.WebAPI", "ClassifiedAds.IdentityServer"]
"configurations": ["ClassifiedAds.Background", "ClassifiedAds.Migrator", "ClassifiedAds.WebAPI", "ClassifiedAds.IdentityServer"]
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ClassifiedAds.BackgroundServer\ClassifiedAds.BackgroundServer.csproj" />
<ProjectReference Include="..\ClassifiedAds.Background\ClassifiedAds.Background.csproj" />
<ProjectReference Include="..\ClassifiedAds.Migrator\ClassifiedAds.Migrator.csproj" />
<ProjectReference Include="..\ClassifiedAds.WebAPI\ClassifiedAds.WebAPI.csproj" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/ModularMonolith/ClassifiedAds.AspireAppHost/Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var builder = DistributedApplication.CreateBuilder(args);

var migrator = builder.AddProject<Projects.ClassifiedAds_Migrator>("ClassifiedAds-Migrator");
var background = builder.AddProject<Projects.ClassifiedAds_BackgroundServer>("ClassifiedAds-BackgroundServer");
var background = builder.AddProject<Projects.ClassifiedAds_Background>("ClassifiedAds-Background");
var webApi = builder.AddProject<Projects.ClassifiedAds_WebAPI>("ClassifiedAds-WebAPI");

var identityServer = builder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<AssemblyName>ClassifiedAds.BackgroundServer</AssemblyName>
<RootNamespace>ClassifiedAds.BackgroundServer</RootNamespace>
<AssemblyName>ClassifiedAds.Background</AssemblyName>
<RootNamespace>ClassifiedAds.Background</RootNamespace>
<UserSecretsId>b924d88d-1033-40eb-80bd-48272839dd65</UserSecretsId>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using ClassifiedAds.Infrastructure.MessageBrokers;
using Microsoft.Extensions.Options;

namespace ClassifiedAds.BackgroundServer.ConfigurationOptions;
namespace ClassifiedAds.Background.ConfigurationOptions;

public class AppSettings
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ClassifiedAds.Modules.Notification.ConfigurationOptions;
using ClassifiedAds.Modules.Storage.ConfigurationOptions;

namespace ClassifiedAds.BackgroundServer.ConfigurationOptions;
namespace ClassifiedAds.Background.ConfigurationOptions;

public class ModulesOptions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ COPY ./ClassifiedAds.Modules.Notification/*.csproj ./ClassifiedAds.Modules.Notif
COPY ./ClassifiedAds.Modules.Product/*.csproj ./ClassifiedAds.Modules.Product/
COPY ./ClassifiedAds.Modules.Storage/*.csproj ./ClassifiedAds.Modules.Storage/

COPY ./ClassifiedAds.BackgroundServer/*.csproj ./ClassifiedAds.BackgroundServer/
COPY ./ClassifiedAds.Background/*.csproj ./ClassifiedAds.Background/

RUN dotnet restore ./ClassifiedAds.BackgroundServer/ClassifiedAds.BackgroundServer.csproj
RUN dotnet restore ./ClassifiedAds.Background/ClassifiedAds.Background.csproj

# Copy everything else and build
COPY . ./
RUN dotnet publish ./ClassifiedAds.BackgroundServer/ClassifiedAds.BackgroundServer.csproj -c Release -o out
RUN dotnet publish ./ClassifiedAds.Background/ClassifiedAds.Background.csproj -c Release -o out

# Build runtime image
FROM mcr.microsoft.com/dotnet/aspnet:8.0
WORKDIR /ClassifiedAds.ModularMonolith
COPY --from=build-env /ClassifiedAds.ModularMonolith/out .

ENTRYPOINT ["dotnet", "ClassifiedAds.BackgroundServer.dll"]
ENTRYPOINT ["dotnet", "ClassifiedAds.Background.dll"]
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ClassifiedAds.Contracts.Identity.Services;
using System;

namespace ClassifiedAds.BackgroundServer.Identity;
namespace ClassifiedAds.Background.Identity;

public class CurrentUser : ICurrentUser
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using ClassifiedAds.BackgroundServer.ConfigurationOptions;
using ClassifiedAds.BackgroundServer.Identity;
using ClassifiedAds.Background.ConfigurationOptions;
using ClassifiedAds.Background.Identity;
using ClassifiedAds.Contracts.Identity.Services;
using ClassifiedAds.Domain.Infrastructure.MessageBrokers;
using ClassifiedAds.Infrastructure.Logging;
Expand Down Expand Up @@ -48,6 +48,9 @@
.AddStorageModule(opt => configuration.GetSection("Modules:Storage").Bind(opt))
.AddApplicationServices();

services.AddHtmlRazorLightEngine();
services.AddDinkToPdfConverter();

services.AddDataProtection()
.PersistKeysToDbContext<IdentityDbContext>()
.SetApplicationName("ClassifiedAds");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"profiles": {
"ClassifiedAds.BackgroundServer": {
"ClassifiedAds.Background": {
"commandName": "Project",
"dotnetRunMessages": true,
"environmentVariables": {
Expand Down
3 changes: 3 additions & 0 deletions src/ModularMonolith/ClassifiedAds.Migrator/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
})
.AddApplicationServices();

services.AddHtmlRazorLightEngine();
services.AddDinkToPdfConverter();

services.AddDataProtection()
.PersistKeysToDbContext<IdentityDbContext>()
.SetApplicationName("ClassifiedAds");
Expand Down
2 changes: 1 addition & 1 deletion src/ModularMonolith/ClassifiedAds.ModularMonolith.sln
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassifiedAds.Modules.Produ
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassifiedAds.Modules.Product.EndToEndTests", "ClassifiedAds.Modules.Product.EndToEndTests\ClassifiedAds.Modules.Product.EndToEndTests.csproj", "{4795E8FC-5D27-48AB-A148-3E44B13D4AE0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassifiedAds.BackgroundServer", "ClassifiedAds.BackgroundServer\ClassifiedAds.BackgroundServer.csproj", "{4CE975AB-01F3-4D67-94D8-CA049D691E27}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassifiedAds.Background", "ClassifiedAds.Background\ClassifiedAds.Background.csproj", "{4CE975AB-01F3-4D67-94D8-CA049D691E27}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassifiedAds.Modules.Configuration", "ClassifiedAds.Modules.Configuration\ClassifiedAds.Modules.Configuration.csproj", "{B556F32D-D996-4296-9075-E7E2E2F4B8C3}"
EndProject
Expand Down
2 changes: 1 addition & 1 deletion src/ModularMonolith/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pipeline {
stage('Publish') {
steps {
dir('src/ModularMonolith') {
sh "dotnet publish -p:Version=${VERSION} ClassifiedAds.BackgroundServer/*.csproj --configuration Release"
sh "dotnet publish -p:Version=${VERSION} ClassifiedAds.Background/*.csproj --configuration Release"
sh "dotnet publish -p:Version=${VERSION} ClassifiedAds.Migrator/*.csproj --configuration Release"
sh "dotnet publish -p:Version=${VERSION} ClassifiedAds.WebAPI/*.csproj --configuration Release"
}
Expand Down
Loading

0 comments on commit 10d927a

Please sign in to comment.