Skip to content

Commit

Permalink
rename background project
Browse files Browse the repository at this point in the history
  • Loading branch information
phongnguyend committed Oct 25, 2024
1 parent fce9b5d commit 3285e40
Show file tree
Hide file tree
Showing 35 changed files with 64 additions and 71 deletions.
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.backgroundserver
name: {{ .Release.Name}}-backgroundserver
image: phongnguyend/classifiedads.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 @@ -17,8 +17,6 @@ spec:
spec:
containers:
- env:
- name: BackgroundServer__Endpoint
value: http://{{ .Release.Name}}-backgroundserver
- name: CheckDependency__Enabled
value: "true"
- name: CheckDependency__Host
Expand Down
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.backgroundserver
name: backgroundserver
image: phongnguyend/classifiedads.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: {}
2 changes: 0 additions & 2 deletions src/Monolith/.k8s/webmvc.deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ spec:
spec:
containers:
- env:
- name: BackgroundServer__Endpoint
value: http://backgroundserver
- name: CheckDependency__Enabled
value: "true"
- name: CheckDependency__Host
Expand Down
8 changes: 4 additions & 4 deletions src/Monolith/.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 @@ -174,7 +174,7 @@
"compounds": [
{
"name": "ClassifiedAds.Monolith",
"configurations": ["ClassifiedAds.BackgroundServer", "ClassifiedAds.GraphQL", "ClassifiedAds.Migrator", "ClassifiedAds.WebAPI","ClassifiedAds.BlazorServerSide","ClassifiedAds.BlazorWebAssembly","ClassifiedAds.IdentityServer","ClassifiedAds.WebMVC"]
"configurations": ["ClassifiedAds.Background", "ClassifiedAds.GraphQL", "ClassifiedAds.Migrator", "ClassifiedAds.WebAPI","ClassifiedAds.BlazorServerSide","ClassifiedAds.BlazorWebAssembly","ClassifiedAds.IdentityServer","ClassifiedAds.WebMVC"]
}
]
}
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.BlazorServerSide\ClassifiedAds.BlazorServerSide.csproj" />
<ProjectReference Include="..\ClassifiedAds.BlazorWebAssembly\ClassifiedAds.BlazorWebAssembly.csproj" />
<ProjectReference Include="..\ClassifiedAds.GraphQL\ClassifiedAds.GraphQL.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion src/Monolith/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 graphQL = builder.AddProject<Projects.ClassifiedAds_GraphQL>("ClassifiedAds-GraphQL");
var webApi = builder.AddProject<Projects.ClassifiedAds_WebAPI>("ClassifiedAds-WebAPI");
var webMvc = builder.AddProject<Projects.ClassifiedAds_WebMVC>("ClassifiedAds-WebMVC");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using ClassifiedAds.Infrastructure.Storages;
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,4 +1,4 @@
namespace ClassifiedAds.BackgroundServer.ConfigurationOptions;
namespace ClassifiedAds.Background.ConfigurationOptions;

public class ConnectionStrings
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ COPY ./ClassifiedAds.Persistence/*.csproj ./ClassifiedAds.Persistence/
RUN dotnet restore ./ClassifiedAds.Application/ClassifiedAds.Application.csproj
RUN dotnet restore ./ClassifiedAds.Infrastructure/ClassifiedAds.Infrastructure.csproj

COPY ./ClassifiedAds.BackgroundServer/*.csproj ./ClassifiedAds.BackgroundServer/
RUN dotnet restore ./ClassifiedAds.BackgroundServer/ClassifiedAds.BackgroundServer.csproj
COPY ./ClassifiedAds.Background/*.csproj ./ClassifiedAds.Background/
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.Monolith
COPY --from=build-env /ClassifiedAds.Monolith/out .

ENTRYPOINT ["dotnet", "ClassifiedAds.BackgroundServer.dll"]
ENTRYPOINT ["dotnet", "ClassifiedAds.Background.dll"]
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace ClassifiedAds.BackgroundServer.HostedServices;
namespace ClassifiedAds.Background.HostedServices;

public class PublishEventWorker : BackgroundService
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace ClassifiedAds.BackgroundServer.HostedServices;
namespace ClassifiedAds.Background.HostedServices;

public class ScheduleCronJobWorker : CronJobBackgroundService
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace ClassifiedAds.BackgroundServer.HostedServices;
namespace ClassifiedAds.Background.HostedServices;

public class SendEmailWorker : BackgroundService
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace ClassifiedAds.BackgroundServer.HostedServices;
namespace ClassifiedAds.Background.HostedServices;

public class SendSmsWorker : BackgroundService
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace ClassifiedAds.BackgroundServer.HostedServices;
namespace ClassifiedAds.Background.HostedServices;

public class SyncUsersWorker : BackgroundService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ClassifiedAds.Domain.Identity;
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
Expand Up @@ -7,7 +7,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace ClassifiedAds.BackgroundServer.MessageBusConsumers;
namespace ClassifiedAds.Background.MessageBusConsumers;

public sealed class WebhookConsumer :
IMessageBusConsumer<WebhookConsumer, FileUploadedEvent>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
using System.Threading;
using System.Threading.Tasks;

namespace ClassifiedAds.BackgroundServer.OutBoxEventPublishers;
namespace ClassifiedAds.Background.OutBoxEventPublishers;

public class FileEntryOutBoxEventPublisher : IOutBoxEventPublisher
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using ClassifiedAds.Application.FileEntries.DTOs;
using ClassifiedAds.BackgroundServer.ConfigurationOptions;
using ClassifiedAds.BackgroundServer.HostedServices;
using ClassifiedAds.BackgroundServer.Identity;
using ClassifiedAds.BackgroundServer.MessageBusConsumers;
using ClassifiedAds.Background.ConfigurationOptions;
using ClassifiedAds.Background.HostedServices;
using ClassifiedAds.Background.Identity;
using ClassifiedAds.Background.MessageBusConsumers;
using ClassifiedAds.CrossCuttingConcerns.Exceptions;
using ClassifiedAds.Domain.Identity;
using ClassifiedAds.Domain.IdentityProviders;
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
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"OpenTelemetry": {
"IsEnabled": true,
"ServiceName": "ClassifiedAds.BackgroundServer",
"ServiceName": "ClassifiedAds.Background",
"Otlp": {
"IsEnabled": true,
"Endpoint": "https://localhost:21052"
Expand Down
2 changes: 1 addition & 1 deletion src/Monolith/ClassifiedAds.Monolith.sln
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{60BC7A82
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassifiedAds.GraphQL", "ClassifiedAds.GraphQL\ClassifiedAds.GraphQL.csproj", "{FDBA0506-A4E7-405B-918D-66A195F16C95}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassifiedAds.BackgroundServer", "ClassifiedAds.BackgroundServer\ClassifiedAds.BackgroundServer.csproj", "{72E42908-63F6-4981-9023-6018C66604D8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClassifiedAds.Background", "ClassifiedAds.Background\ClassifiedAds.Background.csproj", "{72E42908-63F6-4981-9023-6018C66604D8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "BackEnds", "BackEnds", "{62A1AB08-A2DB-404F-B073-0F89CA780F45}"
EndProject
Expand Down
3 changes: 0 additions & 3 deletions src/Monolith/ClassifiedAds.WebMVC/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
"Endpoint": "https://localhost:44390",
"PublicEndpoint": "https://localhost:44390"
},
"BackgroundServer": {
"Endpoint": "https://localhost:44318"
},
"Logging": {
"LogLevel": {
"Default": "Information",
Expand Down
2 changes: 1 addition & 1 deletion src/Monolith/Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pipeline {
stage('Publish') {
steps {
dir('src/Monolith') {
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.GraphQL/*.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
10 changes: 5 additions & 5 deletions src/Monolith/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
| Project | Configuration File | Configuration Key |
| -------- | ------------------ | ----------------- |
| ClassifiedAds.Migrator | [appsettings.json](ClassifiedAds.Migrator/appsettings.json) | ConnectionStrings:ClassifiedAds |
| ClassifiedAds.BackgroundServer | [appsettings.json](ClassifiedAds.BackgroundServer/appsettings.json) | ConnectionStrings:ClassifiedAds |
| ClassifiedAds.Background | [appsettings.json](ClassifiedAds.Background/appsettings.json) | ConnectionStrings:ClassifiedAds |
| ClassifiedAds.IdentityServer | [appsettings.json](../IdentityServer/IdentityServer4/ClassifiedAds.IdentityServer/appsettings.json) | ConnectionStrings:ClassifiedAds |
| ClassifiedAds.WebAPI | [appsettings.json](ClassifiedAds.WebAPI/appsettings.json) | ConnectionStrings:ClassifiedAds |
| ClassifiedAds.WebMVC | [appsettings.json](ClassifiedAds.WebMVC/appsettings.json) | ConnectionStrings:ClassifiedAds |
Expand Down Expand Up @@ -53,7 +53,7 @@
- Tag
```
docker tag classifiedads.backgroundserver phongnguyend/classifiedads.backgroundserver
docker tag classifiedads.background phongnguyend/classifiedads.background
docker tag classifiedads.migrator phongnguyend/classifiedads.migrator
docker tag classifiedads.webapi phongnguyend/classifiedads.webapi
docker tag classifiedads.graphql phongnguyend/classifiedads.graphql
Expand All @@ -64,7 +64,7 @@
- Push
```
docker push phongnguyend/classifiedads.backgroundserver
docker push phongnguyend/classifiedads.background
docker push phongnguyend/classifiedads.migrator
docker push phongnguyend/classifiedads.webapi
docker push phongnguyend/classifiedads.graphql
Expand Down Expand Up @@ -116,7 +116,7 @@
dotnet build -p:Version=1.0.0.1 -c Release

dotnet publish -p:Version=1.0.0.1 -c Release ../IdentityServer/IdentityServer4/ClassifiedAds.IdentityServer/ClassifiedAds.IdentityServer.csproj -o ./publish/ClassifiedAds.IdentityServer
dotnet publish -p:Version=1.0.0.1 -c Release ./ClassifiedAds.BackgroundServer/ClassifiedAds.BackgroundServer.csproj -o ./publish/ClassifiedAds.BackgroundServer
dotnet publish -p:Version=1.0.0.1 -c Release ./ClassifiedAds.Background/ClassifiedAds.Background.csproj -o ./publish/ClassifiedAds.Background
dotnet publish -p:Version=1.0.0.1 -c Release ./ClassifiedAds.GraphQL/ClassifiedAds.GraphQL.csproj -o ./publish/ClassifiedAds.GraphQL
dotnet publish -p:Version=1.0.0.1 -c Release ./ClassifiedAds.Migrator/ClassifiedAds.Migrator.csproj -o ./publish/ClassifiedAds.Migrator
dotnet publish -p:Version=1.0.0.1 -c Release ./ClassifiedAds.WebAPI/ClassifiedAds.WebAPI.csproj -o ./publish/ClassifiedAds.WebAPI
Expand All @@ -128,7 +128,7 @@
- Pack
```
dotnet octo pack --version=1.0.0.1 --outFolder=./publish --overwrite --id=ClassifiedAds.IdentityServer --basePath=./publish/ClassifiedAds.IdentityServer
dotnet octo pack --version=1.0.0.1 --outFolder=./publish --overwrite --id=ClassifiedAds.BackgroundServer --basePath=./publish/ClassifiedAds.BackgroundServer
dotnet octo pack --version=1.0.0.1 --outFolder=./publish --overwrite --id=ClassifiedAds.Background --basePath=./publish/ClassifiedAds.Background
dotnet octo pack --version=1.0.0.1 --outFolder=./publish --overwrite --id=ClassifiedAds.GraphQL --basePath=./publish/ClassifiedAds.GraphQL
dotnet octo pack --version=1.0.0.1 --outFolder=./publish --overwrite --id=ClassifiedAds.Migrator --basePath=./publish/ClassifiedAds.Migrator
dotnet octo pack --version=1.0.0.1 --outFolder=./publish --overwrite --id=ClassifiedAds.WebAPI --basePath=./publish/ClassifiedAds.WebAPI
Expand Down
Loading

0 comments on commit 3285e40

Please sign in to comment.