Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4bf91c6abf | |||
| 5a51926a83 | |||
| f5d6e9e35c | |||
| de5fa0fdd4 | |||
| f084ff97e5 | |||
| d1020581cf | |||
| f715c50306 | |||
| 7fc448d525 | |||
| fcd8c2ede7 | |||
| 8f48e11738 | |||
| 9ae11b9b03 | |||
| a44dcdb8f8 |
@@ -83,6 +83,8 @@ steps:
|
|||||||
- mkdir -p $HOME/.kube
|
- mkdir -p $HOME/.kube
|
||||||
- echo "$KUBE_CONFIG" > $HOME/.kube/config
|
- echo "$KUBE_CONFIG" > $HOME/.kube/config
|
||||||
- kubectl apply -f litecharms-shop-uat.yml
|
- kubectl apply -f litecharms-shop-uat.yml
|
||||||
|
- sleep 10
|
||||||
|
- kubectl rollout restart deployment/litecharms-shop -n litecharms-shop-uat
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- package
|
- package
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
# LiteCharmsShop
|
||||||
|
|
||||||
|
The primary customer-facing web application for the LiteCharms platform.
|
||||||
|
|
||||||
|
## 🏗 Architecture
|
||||||
|
* **Type:** Kubernetes Deployment
|
||||||
|
* **Scale:** Horizontal scaling enabled via `replicas`.
|
||||||
|
* **Ingress:** Managed via `IngressRouter` for external traffic routing.
|
||||||
|
|
||||||
|
## 🚀 CI/CD Workflow
|
||||||
|
* **Trigger:** Pull Request to `master`.
|
||||||
|
* **Build:** Compiles .NET 10.0 source.
|
||||||
|
* **Containerize:** Docker image pushed to Nexus as `litecharms-scheduler:1.${DRONE_BUILD_NUMBER}`.
|
||||||
|
* **Deploy:** * Updates UAT via `kubectl apply`.
|
||||||
|
* Production deployment is triggered via **Promotion** to the `production` target.
|
||||||
|
|
||||||
|
## 🌐 Endpoints
|
||||||
|
* **UAT:** `https://uat-shop.khongisa.co.za` (Internal/VPN)
|
||||||
|
* **Monitoring:** Aspire Dashboard enabled via `Monitoring__Address`.
|
||||||
@@ -1,9 +1,11 @@
|
|||||||
using LiteCharms.Features.Utilities.Commands;
|
using LiteCharms.Features.Email.Events;
|
||||||
using LiteCharms.Models;
|
using LiteCharms.Features.Email.Models;
|
||||||
|
using LiteCharms.Features.ServiceBus.Abstractions;
|
||||||
|
using static LiteCharms.Features.ServiceBus.Constants;
|
||||||
|
|
||||||
namespace Shop.Components.Pages;
|
namespace Shop.Components.Pages;
|
||||||
|
|
||||||
public partial class Contact(ISender mediator, IToastService toastService) : IDisposable
|
public partial class Contact([FromKeyedServices(EmailServiceBus)] IEventBus emailBus, IToastService toastService) : IDisposable
|
||||||
{
|
{
|
||||||
public CancellationTokenSource TokenSource { get; set; } = new();
|
public CancellationTokenSource TokenSource { get; set; } = new();
|
||||||
|
|
||||||
@@ -13,10 +15,9 @@ public partial class Contact(ISender mediator, IToastService toastService) : IDi
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var request = SendEmailCommand.Create(Input.EmailAddress!, Input.FullName!, "shop@litecharms.co.za",
|
var notification = SendShopEmailEnquiryEvent.Create(Input.FullName!, Input.EmailAddress!, Input.EmailSubject!, Input.Message!);
|
||||||
"Khongisa Shop", Input.EmailSubject!, Input.Message!);
|
|
||||||
|
|
||||||
var result = await mediator.Send(request, TokenSource.Token);
|
var result = await emailBus.PublishAsync(notification, TokenSource.Token);
|
||||||
|
|
||||||
if (result.IsFailed)
|
if (result.IsFailed)
|
||||||
{
|
{
|
||||||
|
|||||||
+13
-3
@@ -1,6 +1,7 @@
|
|||||||
using LiteCharms.Extensions;
|
using LiteCharms.Features.Extensions;
|
||||||
|
using LiteCharms.Features.Mediator;
|
||||||
using Shop.Components;
|
using Shop.Components;
|
||||||
using static LiteCharms.Abstractions.Constants;
|
using static LiteCharms.Features.Email.Extensions.Constants;
|
||||||
|
|
||||||
var builder = WebApplication.CreateBuilder(args);
|
var builder = WebApplication.CreateBuilder(args);
|
||||||
|
|
||||||
@@ -14,11 +15,20 @@ builder.Services.AddBlazoredToast();
|
|||||||
builder.Services.AddEndpointsApiExplorer();
|
builder.Services.AddEndpointsApiExplorer();
|
||||||
|
|
||||||
builder.Services.AddMediator();
|
builder.Services.AddMediator();
|
||||||
|
|
||||||
|
builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(TelemetryPipelineBehavior<,>));
|
||||||
|
builder.Services.AddScoped(typeof(IPipelineBehavior<,>), typeof(LoggingPipelineBehavior<,>));
|
||||||
|
|
||||||
builder.Services.AddSalesServiceBus();
|
builder.Services.AddSalesServiceBus();
|
||||||
builder.Services.AddGeneralServiceBus();
|
builder.Services.AddGeneralServiceBus();
|
||||||
builder.Services.AddShopDatabase(builder.Configuration);
|
|
||||||
builder.Services.AddQuartzSchedulerClient(ShopSchedulerName, builder.Configuration);
|
builder.Services.AddQuartzSchedulerClient(ShopSchedulerName, builder.Configuration);
|
||||||
|
|
||||||
|
builder.Services.AddEmailServices(builder.Configuration);
|
||||||
|
builder.Services.AddEmailServiceBus();
|
||||||
|
|
||||||
|
builder.Services.AddShopServices();
|
||||||
|
builder.Services.AddShopDatabase(builder.Configuration);
|
||||||
|
|
||||||
builder.Services.AddPostgresHealtchCheck();
|
builder.Services.AddPostgresHealtchCheck();
|
||||||
builder.Services.AddQuartzHealtchCheck();
|
builder.Services.AddQuartzHealtchCheck();
|
||||||
builder.Services.AddHealthChecksSupport(builder.Configuration);
|
builder.Services.AddHealthChecksSupport(builder.Configuration);
|
||||||
|
|||||||
+1
-3
@@ -17,9 +17,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="LiteCharms.Extensions" Version="1.14.0" />
|
<PackageReference Include="LiteCharms.Features" Version="1.32.0" />
|
||||||
<PackageReference Include="LiteCharms.Features" Version="1.14.0" />
|
|
||||||
<PackageReference Include="LiteCharms.Models" Version="1.14.0" />
|
|
||||||
<PackageReference Include="Polly" Version="8.6.6" />
|
<PackageReference Include="Polly" Version="8.6.6" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,8 @@
|
|||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
"Default": "Information",
|
"Default": "Information",
|
||||||
"Microsoft.AspNetCore": "Warning"
|
"Microsoft.AspNetCore": "Warning",
|
||||||
|
"Microsoft.EntityFrameworkCore": "Error"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"AllowedHosts": "*"
|
"AllowedHosts": "*"
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ metadata:
|
|||||||
namespace: litecharms-shop-uat
|
namespace: litecharms-shop-uat
|
||||||
type: Opaque
|
type: Opaque
|
||||||
data:
|
data:
|
||||||
connection-string: SG9zdD0xOTIuMTY4LjEuMTcwO0RhdGFiYXNlPWxlYWRnZW5lcmF0b3ItZGV2O1VzZXJuYW1lPWxlYWRnZW5lcmF0b3I7UGFzc3dvcmQ9S2VLNDRsczRQWHBuYms7UGVyc2lzdCBTZWN1cml0eSBJbmZvPVRydWU=
|
connection-string: SG9zdD0xOTIuMTY4LjEuMTcwO0RhdGFiYXNlPXNob3AtZGV2O1VzZXJuYW1lPXNob3AtZGV2LXVzZXI7UGFzc3dvcmQ9a1ZWbW9XS0ozeHpnUVg7UGVyc2lzdCBTZWN1cml0eSBJbmZvPVRydWU=
|
||||||
quartz-store: SG9zdD0xOTIuMTY4LjEuMTcwO0RhdGFiYXNlPXNjaGVkdWxlci1kZXY7VXNlcm5hbWU9c2NoZWR1bGVyLWRldi11c2VyO1Bhc3N3b3JkPWtWVm1vV0tKM3h6Z1FYO1BlcnNpc3QgU2VjdXJpdHkgSW5mbz1UcnVl
|
connection-string-quartz: SG9zdD0xOTIuMTY4LjEuMTcwO0RhdGFiYXNlPXNjaGVkdWxlci1kZXY7VXNlcm5hbWU9c2NoZWR1bGVyLWRldi11c2VyO1Bhc3N3b3JkPWtWVm1vV0tKM3h6Z1FYO1BlcnNpc3QgU2VjdXJpdHkgSW5mbz1UcnVl
|
||||||
aspire-apikey: bWMzRzYzSzJqNVpPRXNpMEFqTW9qTFRYbTFLRVpGY3R6SUlqU3dEaVRHdXQ4cUdTa1B1V3d4R1AxUmJzY0pVbw==
|
aspire-apikey: bWMzRzYzSzJqNVpPRXNpMEFqTW9qTFRYbTFLRVpGY3R6SUlqU3dEaVRHdXQ4cUdTa1B1V3d4R1AxUmJzY0pVbw==
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
@@ -44,7 +44,7 @@ metadata:
|
|||||||
name: litecharms-shop
|
name: litecharms-shop
|
||||||
namespace: litecharms-shop-uat
|
namespace: litecharms-shop-uat
|
||||||
spec:
|
spec:
|
||||||
replicas: 2
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: shop
|
app: shop
|
||||||
@@ -81,7 +81,7 @@ spec:
|
|||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
name: shop-secrets
|
name: shop-secrets
|
||||||
key: quartz-store
|
key: connection-string-quartz
|
||||||
- name: ConnectionStrings__PostgresShop
|
- name: ConnectionStrings__PostgresShop
|
||||||
valueFrom:
|
valueFrom:
|
||||||
secretKeyRef:
|
secretKeyRef:
|
||||||
|
|||||||
Reference in New Issue
Block a user