Author | SHA1 | Message | Date |
---|---|---|---|
Sumit Ghosh | 1d8ad96839 | Merge branch 'feature/enable-tye' of https://github.com/dotnet-architecture/eShopOnContainers into feature/enable-tye | 4 years ago |
Sumit Ghosh | 5b4adb7235 | Refactored tye yamls for all services | 4 years ago |
Nish Anil |
19a3735c09
|
Merge dev to feature branch (#1476)
* Fixed firewall rules check and improved the script the check shall be like ~ Get-NetFirewallRule -DisplayName eShopOnContainers-* -ErrorAction Stop * #1397: Replaced deprecated docker.for.win.localhost by host.docker.internal in src/.env (#1400) * Updated Readme (#1402) Fixed sentence structure in Readme. Changed "and a several" to "with several." * CatalogService: Fix issue with Status set when items list is empty (#1304) * Fix issue with Status set when items list is empty * Change method Count() call to Count property Co-authored-by: Dmytro Hridin <v-dmytro.hridin@lionbridge.com> * refactored Equals() method on ValueObject (#1316) * Fix/1403and1404 removed duplicate Key SubscriptionClientName and added app.UseAuthorization() call (#1406) * #1403 removed duplicate Key SubscriptionClientName Removed duplicate key SubscriptionClientName from Tests/Services/Application.FunctionalTests/Services/Marketing/appsettings.json and sorted its content in asc order. * #1404 Added app.UseAuthorization() call Added app.UseAuthorization() call to BasketTestsStartup, LocationsTestsStartup, and MarketingTestsStartup to fix failed unit tests IntegrationEventsScenarios.Post_update_product_price_and_catalog_and_basket_list_modified and MarketingScenarios.Set_new_user_location_and_get_location_campaign_by_user_id (see #1404) * Fix for Campaigns exception and SignalR 401 Unauthorized (#1374) * update API Gateway - /locations-api/ @ webmarketing/envoy.yaml * updated signalr services - envoy: webmarketingapigw - latest client: webmvc - service hub: ordering-signalrhub Co-authored-by: hfz-r <hafiz.roslan@hartalega.com.my> * Mis-Spelled 'client' (#1411) * fix parameter error in multiarch job (#1413) * Private readonly string changed to private const string (#1288) * fix disposing of direct instantiated objects in calalog service #1392 (#1395) * Updated version of different packages. (#1420) * for issue #1423: changed literal string "OpenIdConnect" to constant string (#1424) Co-authored-by: Jeremiah Flaga <j.flaga@arcanys.com> * Updated node-fetch package version. (#1426) * Updated node-fetch package version. * Updated node-forge version. * Fixes #1474: webspa container does not build when running docker-compose up.Updated sha hashes in packages-lock.json (#1475) * Change ReadAllBytes to ReadAllBytesAsync in PicController (#1425) Co-authored-by: edmondshtogu <edmondshtogu@gmail.com> Co-authored-by: InstanceFactory <InstanceFactory@users.noreply.github.com> Co-authored-by: Sumit Ghosh <sumit.ghosh@neudesic.com> Co-authored-by: Yosef Herskovitz <34112131+H3RSKO@users.noreply.github.com> Co-authored-by: Dmytro Hridin <dmytro.hridin@gmail.com> Co-authored-by: Dmytro Hridin <v-dmytro.hridin@lionbridge.com> Co-authored-by: André Silva <andrefilipegsilva@outlook.com> Co-authored-by: hfz-r <39443205+hfz-r@users.noreply.github.com> Co-authored-by: hfz-r <hafiz.roslan@hartalega.com.my> Co-authored-by: Majid Ali Khan Quaid <contactmakq@gmail.com> Co-authored-by: Javier Vela <fjvela@gmail.com> Co-authored-by: Facundo La Rocca <facundo_larocca@yahoo.com.ar> Co-authored-by: Nabil Sedoud <nsedoud@gmail.com> Co-authored-by: jeremiahflaga <flaga.jeremiah@gmail.com> Co-authored-by: Jeremiah Flaga <j.flaga@arcanys.com> Co-authored-by: Wojciech Rak <wojciechrak@users.noreply.github.com> Co-authored-by: Zakaria <23211915+zakaria-c@users.noreply.github.com> |
4 years ago |
Sumit Ghosh | 576ce3165d | Enabled Zipkin tracing for all the projects. | 4 years ago |
Sumit Ghosh | c5298158ef | Introduced polly retry policy for Ordering.API | 4 years ago |
Sumit Ghosh | 49aac0ce77 | Introducted Retry logic in Marketing.API with polly policy. | 4 years ago |
Sumit Ghosh | 5bf33b26fb | Updated polly policy in WebHostExtensions | 4 years ago |
Sumit Ghosh | c10b4ac934 | Updated tye yaml | 4 years ago |
Sumit Ghosh | 0a66edc61b | Updated envoy yaml for tye specific configuration. | 4 years ago |
Sumit Ghosh | d93f6c2f89 | Updated tye yaml with all service configuration. | 4 years ago |
Sumit Ghosh | 0972643c5f | First version of tye.yaml has been included in the solution. | 4 years ago |
@ -1,26 +1,53 @@ | |||||
param([switch]$Elevated) | |||||
param( | |||||
[string]$Name = "eShopOnContainers", | |||||
[string]$InboundDisplayName = "eShopOnContainers-Inbound", | |||||
[string]$OutboundDisplayName = "eShopOnContainers-Outbound", | |||||
[switch]$Elevated | |||||
) | |||||
function Check-Admin { | function Check-Admin { | ||||
$currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent()) | |||||
$currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) | |||||
$currentUser = New-Object Security.Principal.WindowsPrincipal $([Security.Principal.WindowsIdentity]::GetCurrent()) | |||||
$currentUser.IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator) | |||||
} | } | ||||
if ((Check-Admin) -eq $false) { | |||||
if ($elevated) | |||||
{ | |||||
# could not elevate, quit | |||||
function Add-InboundRule { | |||||
New-NetFirewallRule -DisplayName $InboundDisplayName -Confirm -Description "$Name Inbound Rule for port range 5100-5150" -LocalAddress Any -LocalPort 5100-5150 -Protocol tcp -RemoteAddress Any -RemotePort Any -Direction Inbound | |||||
} | } | ||||
else { | |||||
Start-Process powershell.exe -Verb RunAs -ArgumentList ('-noprofile -noexit -file "{0}" -elevated' -f ($myinvocation.MyCommand.Definition)) | |||||
function Add-OutboundRule { | |||||
New-NetFirewallRule -DisplayName $OutboundDisplayName -Confirm -Description "$Name Outbound Rule for port range 5100-5150" -LocalAddress Any -LocalPort 5100-5150 -Protocol tcp -RemoteAddress Any -RemotePort Any -Direction Outbound | |||||
} | } | ||||
exit | |||||
if ((Check-Admin) -eq $false) { | |||||
if ($elevated) | |||||
{ | |||||
# could not elevate, quit | |||||
} | |||||
else { | |||||
Start-Process powershell.exe -Verb RunAs -ArgumentList ('-noprofile -noexit -file "{0}" -elevated' -f ($myinvocation.MyCommand.Definition)) | |||||
} | |||||
exit | |||||
} | } | ||||
try { | try { | ||||
Get-NetFirewallRule -DisplayName EshopDocker -ErrorAction Stop | |||||
Write-Host "Rule found" | |||||
$rules = $(Get-NetFirewallRule -DisplayName $Name-* -ErrorAction Stop | Out-String) | |||||
if (!$rules.Contains($InboundDisplayName) -and !$rules.Contains($OutboundDisplayName)) | |||||
{ | |||||
Add-InboundRule | |||||
Add-OutboundRule | |||||
} | |||||
elseif (!$rules.Contains($InboundDisplayName)) | |||||
{ | |||||
Add-InboundRule | |||||
} | |||||
elseif (!$rules.Contains($OutboundDisplayName)) | |||||
{ | |||||
Add-OutboundRule | |||||
} | |||||
else{ | |||||
Write-Host "Rules found!" | |||||
} | |||||
} | |||||
catch [Exception] { | |||||
Add-InboundRule | |||||
Add-OutboundRule | |||||
} | } | ||||
catch [Exception] { | |||||
New-NetFirewallRule -DisplayName eShopOnContainers-Inbound -Confirm -Description "eShopOnContainers Inbound Rule for port range 5100-5150" -LocalAddress Any -LocalPort 5100-5150 -Protocol tcp -RemoteAddress Any -RemotePort Any -Direction Inbound | |||||
New-NetFirewallRule -DisplayName eShopOnContainers-Outbound -Confirm -Description "eShopOnContainers Outbound Rule for port range 5100-5150" -LocalAddress Any -LocalPort 5100-5150 -Protocol tcp -RemoteAddress Any -RemotePort Any -Direction Outbound | |||||
} |
@ -0,0 +1,76 @@ | |||||
admin: | |||||
access_log_path: "/dev/null" | |||||
address: | |||||
socket_address: | |||||
address: 0.0.0.0 | |||||
port_value: 8001 | |||||
static_resources: | |||||
listeners: | |||||
- address: | |||||
socket_address: | |||||
address: 0.0.0.0 | |||||
port_value: 80 | |||||
filter_chains: | |||||
- filters: | |||||
- name: envoy.http_connection_manager | |||||
config: | |||||
codec_type: auto | |||||
stat_prefix: ingress_http | |||||
route_config: | |||||
name: eshop_backend_route | |||||
virtual_hosts: | |||||
- name: eshop_backend | |||||
domains: | |||||
- "*" | |||||
routes: | |||||
- name: "m-short" | |||||
match: | |||||
prefix: "/m/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
prefix_rewrite: "/" | |||||
cluster: marketing | |||||
- name: "m-long" | |||||
match: | |||||
prefix: "/marketing-api/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
prefix_rewrite: "/" | |||||
cluster: marketing | |||||
http_filters: | |||||
- name: envoy.router | |||||
access_log: | |||||
- name: envoy.file_access_log | |||||
filter: | |||||
not_health_check_filter: {} | |||||
config: | |||||
json_format: | |||||
time: "%START_TIME%" | |||||
protocol: "%PROTOCOL%" | |||||
duration: "%DURATION%" | |||||
request_method: "%REQ(:METHOD)%" | |||||
request_host: "%REQ(HOST)%" | |||||
path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%" | |||||
response_flags: "%RESPONSE_FLAGS%" | |||||
route_name: "%ROUTE_NAME%" | |||||
upstream_host: "%UPSTREAM_HOST%" | |||||
upstream_cluster: "%UPSTREAM_CLUSTER%" | |||||
upstream_local_address: "%UPSTREAM_LOCAL_ADDRESS%" | |||||
path: "/tmp/access.log" | |||||
clusters: | |||||
- name: marketing | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: host.docker.internal | |||||
port_value: 5110 | |||||
- name: locations | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: host.docker.internal | |||||
port_value: 80 |
@ -0,0 +1,139 @@ | |||||
admin: | |||||
access_log_path: "/dev/null" | |||||
address: | |||||
socket_address: | |||||
address: 0.0.0.0 | |||||
port_value: 8001 | |||||
static_resources: | |||||
listeners: | |||||
- address: | |||||
socket_address: | |||||
address: 0.0.0.0 | |||||
port_value: 80 | |||||
filter_chains: | |||||
- filters: | |||||
- name: envoy.http_connection_manager | |||||
config: | |||||
codec_type: auto | |||||
stat_prefix: ingress_http | |||||
route_config: | |||||
name: eshop_backend_route | |||||
virtual_hosts: | |||||
- name: eshop_backend | |||||
domains: | |||||
- "*" | |||||
routes: | |||||
- name: "c-short" | |||||
match: | |||||
prefix: "/c/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
prefix_rewrite: "/" | |||||
cluster: catalog | |||||
- name: "c-long" | |||||
match: | |||||
prefix: "/catalog-api/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
cluster: catalog | |||||
- name: "o-short" | |||||
match: | |||||
prefix: "/o/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
prefix_rewrite: "/" | |||||
cluster: ordering | |||||
- name: "o-long" | |||||
match: | |||||
prefix: "/ordering-api/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
cluster: ordering | |||||
- name: "h-long" | |||||
match: | |||||
prefix: "/hub/notificationhub" | |||||
route: | |||||
auto_host_rewrite: true | |||||
cluster: signalr-hub | |||||
timeout: 300s | |||||
- name: "b-short" | |||||
match: | |||||
prefix: "/b/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
prefix_rewrite: "/" | |||||
cluster: basket | |||||
- name: "b-long" | |||||
match: | |||||
prefix: "/basket-api/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
cluster: basket | |||||
- name: "agg" | |||||
match: | |||||
prefix: "/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
prefix_rewrite: "/" | |||||
cluster: shoppingagg | |||||
http_filters: | |||||
- name: envoy.router | |||||
access_log: | |||||
- name: envoy.file_access_log | |||||
filter: | |||||
not_health_check_filter: {} | |||||
config: | |||||
json_format: | |||||
time: "%START_TIME%" | |||||
protocol: "%PROTOCOL%" | |||||
duration: "%DURATION%" | |||||
request_method: "%REQ(:METHOD)%" | |||||
request_host: "%REQ(HOST)%" | |||||
path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%" | |||||
response_flags: "%RESPONSE_FLAGS%" | |||||
route_name: "%ROUTE_NAME%" | |||||
upstream_host: "%UPSTREAM_HOST%" | |||||
upstream_cluster: "%UPSTREAM_CLUSTER%" | |||||
upstream_local_address: "%UPSTREAM_LOCAL_ADDRESS%" | |||||
path: "/tmp/access.log" | |||||
clusters: | |||||
- name: shoppingagg | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: host.docker.internal | |||||
port_value: 5121 | |||||
- name: catalog | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: host.docker.internal | |||||
port_value: 5101 | |||||
- name: basket | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: host.docker.internal | |||||
port_value: 5103 | |||||
- name: ordering | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: host.docker.internal | |||||
port_value: 5102 | |||||
- name: signalr-hub | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: host.docker.internal | |||||
port_value: 5112 |
@ -0,0 +1,76 @@ | |||||
admin: | |||||
access_log_path: "/dev/null" | |||||
address: | |||||
socket_address: | |||||
address: 0.0.0.0 | |||||
port_value: 8001 | |||||
static_resources: | |||||
listeners: | |||||
- address: | |||||
socket_address: | |||||
address: 0.0.0.0 | |||||
port_value: 80 | |||||
filter_chains: | |||||
- filters: | |||||
- name: envoy.http_connection_manager | |||||
config: | |||||
codec_type: auto | |||||
stat_prefix: ingress_http | |||||
route_config: | |||||
name: eshop_backend_route | |||||
virtual_hosts: | |||||
- name: eshop_backend | |||||
domains: | |||||
- "*" | |||||
routes: | |||||
- name: "m-short" | |||||
match: | |||||
prefix: "/m/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
prefix_rewrite: "/" | |||||
cluster: marketing | |||||
- name: "m-long" | |||||
match: | |||||
prefix: "/marketing-api/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
prefix_rewrite: "/" | |||||
cluster: marketing | |||||
http_filters: | |||||
- name: envoy.router | |||||
access_log: | |||||
- name: envoy.file_access_log | |||||
filter: | |||||
not_health_check_filter: {} | |||||
config: | |||||
json_format: | |||||
time: "%START_TIME%" | |||||
protocol: "%PROTOCOL%" | |||||
duration: "%DURATION%" | |||||
request_method: "%REQ(:METHOD)%" | |||||
request_host: "%REQ(HOST)%" | |||||
path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%" | |||||
response_flags: "%RESPONSE_FLAGS%" | |||||
route_name: "%ROUTE_NAME%" | |||||
upstream_host: "%UPSTREAM_HOST%" | |||||
upstream_cluster: "%UPSTREAM_CLUSTER%" | |||||
upstream_local_address: "%UPSTREAM_LOCAL_ADDRESS%" | |||||
path: "/tmp/access.log" | |||||
clusters: | |||||
- name: marketing | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: host.docker.internal | |||||
port_value: 5110 | |||||
- name: locations | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: host.docker.internal | |||||
port_value: 80 |
@ -0,0 +1,139 @@ | |||||
admin: | |||||
access_log_path: "/dev/null" | |||||
address: | |||||
socket_address: | |||||
address: 0.0.0.0 | |||||
port_value: 8001 | |||||
static_resources: | |||||
listeners: | |||||
- address: | |||||
socket_address: | |||||
address: 0.0.0.0 | |||||
port_value: 80 | |||||
filter_chains: | |||||
- filters: | |||||
- name: envoy.http_connection_manager | |||||
config: | |||||
codec_type: auto | |||||
stat_prefix: ingress_http | |||||
route_config: | |||||
name: eshop_backend_route | |||||
virtual_hosts: | |||||
- name: eshop_backend | |||||
domains: | |||||
- "*" | |||||
routes: | |||||
- name: "c-short" | |||||
match: | |||||
prefix: "/c/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
prefix_rewrite: "/" | |||||
cluster: catalog | |||||
- name: "c-long" | |||||
match: | |||||
prefix: "/catalog-api/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
cluster: catalog | |||||
- name: "o-short" | |||||
match: | |||||
prefix: "/o/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
prefix_rewrite: "/" | |||||
cluster: ordering | |||||
- name: "o-long" | |||||
match: | |||||
prefix: "/ordering-api/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
cluster: ordering | |||||
- name: "h-long" | |||||
match: | |||||
prefix: "/hub/notificationhub" | |||||
route: | |||||
auto_host_rewrite: true | |||||
cluster: signalr-hub | |||||
timeout: 300s | |||||
- name: "b-short" | |||||
match: | |||||
prefix: "/b/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
prefix_rewrite: "/" | |||||
cluster: basket | |||||
- name: "b-long" | |||||
match: | |||||
prefix: "/basket-api/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
cluster: basket | |||||
- name: "agg" | |||||
match: | |||||
prefix: "/" | |||||
route: | |||||
auto_host_rewrite: true | |||||
prefix_rewrite: "/" | |||||
cluster: shoppingagg | |||||
http_filters: | |||||
- name: envoy.router | |||||
access_log: | |||||
- name: envoy.file_access_log | |||||
filter: | |||||
not_health_check_filter: {} | |||||
config: | |||||
json_format: | |||||
time: "%START_TIME%" | |||||
protocol: "%PROTOCOL%" | |||||
duration: "%DURATION%" | |||||
request_method: "%REQ(:METHOD)%" | |||||
request_host: "%REQ(HOST)%" | |||||
path: "%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%" | |||||
response_flags: "%RESPONSE_FLAGS%" | |||||
route_name: "%ROUTE_NAME%" | |||||
upstream_host: "%UPSTREAM_HOST%" | |||||
upstream_cluster: "%UPSTREAM_CLUSTER%" | |||||
upstream_local_address: "%UPSTREAM_LOCAL_ADDRESS%" | |||||
path: "/tmp/access.log" | |||||
clusters: | |||||
- name: shoppingagg | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: host.docker.internal | |||||
port_value: 5121 | |||||
- name: catalog | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: host.docker.internal | |||||
port_value: 5101 | |||||
- name: basket | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: host.docker.internal | |||||
port_value: 5103 | |||||
- name: ordering | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: host.docker.internal | |||||
port_value: 5102 | |||||
- name: signalr-hub | |||||
connect_timeout: 0.25s | |||||
type: strict_dns | |||||
lb_policy: round_robin | |||||
hosts: | |||||
- socket_address: | |||||
address: host.docker.internal | |||||
port_value: 5112 |
@ -0,0 +1,43 @@ | |||||
name: eshoponcontainers-servicesandwebapps | |||||
services: | |||||
- name: mobileshoppingagg | |||||
project: Mobile.Shopping.HttpAggregator.csproj | |||||
env: | |||||
- name: ASPNETCORE_ENVIRONMENT | |||||
value: Development | |||||
- name: urls__basket | |||||
value: http://localhost:5103 | |||||
- name: urls__catalog | |||||
value: http://localhost:5101 | |||||
- name: urls__orders | |||||
value: http://localhost:5102 | |||||
- name: urls__identity | |||||
value: http://localhost:5105 | |||||
- name: urls__grpcBasket | |||||
value: http://localhost:9103 | |||||
- name: urls__grpcCatalog | |||||
value: http://localhost:9101 | |||||
- name: urls__grpcOrdering | |||||
value: http://localhost:9102 | |||||
- name: CatalogUrlHC | |||||
value: http://localhost:5101/hc | |||||
- name: OrderingUrlHC | |||||
value: http://localhost:5102/hc | |||||
- name: IdentityUrlHC | |||||
value: http://localhost:5105/hc | |||||
- name: BasketUrlHC | |||||
value: http://localhost:5103/hc | |||||
- name: MarketingUrlHC | |||||
value: http://localhost:5110/hc | |||||
- name: PaymentUrlHC | |||||
value: http://localhost:5108/hc | |||||
- name: LocationUrlHC | |||||
value: http://localhost:5109/hc | |||||
- name: IdentityUrlExternal | |||||
value: http://localhost:5105 | |||||
bindings: | |||||
- name: http-port-80-binding | |||||
port: 5120 | |||||
protocol: http |
@ -0,0 +1,43 @@ | |||||
name: eshoponcontainers-servicesandwebapps | |||||
services: | |||||
- name: webshoppingagg | |||||
project: Web.Shopping.HttpAggregator.csproj | |||||
env: | |||||
- name: ASPNETCORE_ENVIRONMENT | |||||
value: Development | |||||
- name: urls__basket | |||||
value: http://localhost:5103 | |||||
- name: urls__catalog | |||||
value: http://localhost:5101 | |||||
- name: urls__orders | |||||
value: http://localhost:5102 | |||||
- name: urls__identity | |||||
value: http://localhost:5105 | |||||
- name: urls__grpcBasket | |||||
value: http://localhost:9103 | |||||
- name: urls__grpcCatalog | |||||
value: http://localhost:9101 | |||||
- name: urls__grpcOrdering | |||||
value: http://localhost:9102 | |||||
- name: CatalogUrlHC | |||||
value: http://localhost:5101/hc | |||||
- name: OrderingUrlHC | |||||
value: http://localhost:5102/hc | |||||
- name: IdentityUrlHC | |||||
value: http://localhost:5105/hc | |||||
- name: BasketUrlHC | |||||
value: http://localhost:5103/hc | |||||
- name: MarketingUrlHC | |||||
value: http://localhost:5110/hc | |||||
- name: PaymentUrlHC | |||||
value: http://localhost:5108/hc | |||||
- name: LocationUrlHC | |||||
value: http://localhost:5109/hc | |||||
- name: IdentityUrlExternal | |||||
value: http://localhost:5105 | |||||
bindings: | |||||
- name: http-port-80-binding | |||||
port: 5121 | |||||
protocol: http |
@ -0,0 +1,41 @@ | |||||
name: eshoponcontainers-servicesandwebapps | |||||
services: | |||||
- name: basket-api | |||||
project: Basket.API.csproj | |||||
env: | |||||
- name: ASPNETCORE_ENVIRONMENT | |||||
value: Development | |||||
- name: ASPNETCORE_URLS | |||||
value: http://0.0.0.0:80 | |||||
- name: ConnectionString | |||||
value: 127.0.0.1 | |||||
- name: identityUrl | |||||
value: http://localhost:5105 | |||||
- name: IdentityUrlExternal | |||||
value: http://localhost:5105 | |||||
- name: EventBusConnection | |||||
value: localhost | |||||
- name: EventBusUserName | |||||
value: | |||||
- name: EventBusPassword | |||||
value: | |||||
- name: AzureServiceBusEnabled | |||||
value: False | |||||
- name: ApplicationInsights__InstrumentationKey | |||||
value: | |||||
- name: OrchestratorType | |||||
value: | |||||
- name: UseLoadTest | |||||
value: False | |||||
- name: GRPC_PORT | |||||
value: 9103 | |||||
- name: PORT | |||||
value: 80 | |||||
- name: PATH_BASE | |||||
value: /basket-api | |||||
bindings: | |||||
- name: http-port-80-binding | |||||
port: 5103 | |||||
protocol: http |
@ -0,0 +1,43 @@ | |||||
name: eshoponcontainers-servicesandwebapps | |||||
services: | |||||
- name: catalog-api | |||||
project: Catalog.API.csproj | |||||
env: | |||||
- name: ASPNETCORE_ENVIRONMENT | |||||
value: Development | |||||
- name: ConnectionString | |||||
value: Server=localhost;Database=Microsoft.eShopOnContainers.Services.CatalogDb;User Id=sa;Password=Pass@word | |||||
- name: PicBaseUrl | |||||
value: http://localhost:5202/c/api/v1/catalog/items/[0]/pic/ | |||||
- name: EventBusConnection | |||||
value: localhost | |||||
- name: EventBusUserName | |||||
value: | |||||
- name: EventBusPassword | |||||
value: | |||||
- name: AzureStorageAccountName | |||||
value: | |||||
- name: AzureStorageAccountKey | |||||
value: | |||||
- name: UseCustomizationData | |||||
value: True | |||||
- name: AzureServiceBusEnabled | |||||
value: False | |||||
- name: AzureStorageEnabled | |||||
value: False | |||||
- name: ApplicationInsights__InstrumentationKey | |||||
value: | |||||
- name: OrchestratorType | |||||
value: | |||||
- name: GRPC_PORT | |||||
value: 9101 | |||||
- name: PORT | |||||
value: 80 | |||||
- name: PATH_BASE | |||||
value: /catalog-api | |||||
bindings: | |||||
- protocol: http | |||||
name: http-port-80-binding | |||||
port: 5101 |
@ -0,0 +1,44 @@ | |||||
name: eshoponcontainers-servicesandwebapps | |||||
services: | |||||
- name: identity-api | |||||
project: Identity.API.csproj | |||||
env: | |||||
- name: ASPNETCORE_ENVIRONMENT | |||||
value: Development | |||||
- name: ASPNETCORE_URLS | |||||
value: http://0.0.0.0:80 | |||||
- name: SpaClient | |||||
value: http://localhost:5104/ | |||||
- name: XamarinCallback | |||||
value: http://localhost:5105/xamarincallback | |||||
- name: ConnectionString | |||||
value: Server=localhost;Database=Microsoft.eShopOnContainers.Service.IdentityDb;User Id=sa;Password=Pass@word | |||||
- name: MvcClient | |||||
value: http://localhost:5100 | |||||
- name: LocationApiClient | |||||
value: http://localhost:5109 | |||||
- name: MarketingApiClient | |||||
value: http://localhost:5110 | |||||
- name: BasketApiClient | |||||
value: http://localhost:5103 | |||||
- name: OrderingApiClient | |||||
value: http://localhost:5102 | |||||
- name: MobileShoppingAggClient | |||||
value: http://localhost:5120 | |||||
- name: WebShoppingAggClient | |||||
value: http://localhost:5121 | |||||
- name: WebhooksApiClient | |||||
value: http://localhost:5113 | |||||
- name: WebhooksWebClient | |||||
value: http://localhost:5114 | |||||
- name: UseCustomizationData | |||||
value: True | |||||
- name: ApplicationInsights__InstrumentationKey | |||||
value: | |||||
- name: OrchestratorType | |||||
value: | |||||
bindings: | |||||
- name: http-binding | |||||
port: 5105 |
@ -0,0 +1,39 @@ | |||||
name: eshoponcontainers-servicesandwebapps | |||||
services: | |||||
- name: locations-api | |||||
project: Locations.API.csproj | |||||
env: | |||||
- name: ASPNETCORE_ENVIRONMENT | |||||
value: Development | |||||
- name: ASPNETCORE_URLS | |||||
value: http://0.0.0.0:80 | |||||
- name: ConnectionString | |||||
value: mongodb://localhost:27017 | |||||
- name: Database | |||||
value: LocationsDb | |||||
- name: identityUrl | |||||
value: http://localhost:5105 | |||||
- name: IdentityUrlExternal | |||||
value: http://localhost:5105 | |||||
- name: EventBusConnection | |||||
value: localhost | |||||
- name: EventBusUserName | |||||
value: | |||||
- name: EventBusPassword | |||||
value: | |||||
- name: AzureServiceBusEnabled | |||||
value: False | |||||
- name: ApplicationInsights__InstrumentationKey | |||||
value: | |||||
- name: OrchestratorType | |||||
value: | |||||
- name: UseLoadTest | |||||
value: False | |||||
- name: PATH_BASE | |||||
value: /locations-api | |||||
bindings: | |||||
- name: http-port-80-binding | |||||
port: 5109 | |||||
protocol: http |
@ -0,0 +1,75 @@ | |||||
using Microsoft.EntityFrameworkCore; | |||||
using Microsoft.Extensions.Configuration; | |||||
using System; | |||||
using Microsoft.Extensions.DependencyInjection; | |||||
using Microsoft.Extensions.Logging; | |||||
using Polly; | |||||
using System.Data.SqlClient; | |||||
using Microsoft.AspNetCore.Hosting; | |||||
namespace Microsoft.eShopOnContainers.Services.Marketing.API.Extensions | |||||
{ | |||||
public static class WebHostExtensions | |||||
{ | |||||
public static bool IsInKubernetes(this IWebHost host) | |||||
{ | |||||
var cfg = host.Services.GetService<IConfiguration>(); | |||||
var orchestratorType = cfg.GetValue<string>("OrchestratorType"); | |||||
return orchestratorType?.ToUpper() == "K8S"; | |||||
} | |||||
public static IWebHost MigrateDbContext<TContext>(this IWebHost host, Action<TContext, IServiceProvider> seeder) where TContext : DbContext | |||||
{ | |||||
var underK8s = host.IsInKubernetes(); | |||||
using (var scope = host.Services.CreateScope()) | |||||
{ | |||||
var services = scope.ServiceProvider; | |||||
var logger = services.GetRequiredService<ILogger<TContext>>(); | |||||
var context = services.GetService<TContext>(); | |||||
try | |||||
{ | |||||
logger.LogInformation("Migrating database associated with context {DbContextName}", typeof(TContext).Name); | |||||
if (underK8s) | |||||
{ | |||||
InvokeSeeder(seeder, context, services); | |||||
} | |||||
else | |||||
{ | |||||
var retry = Policy.Handle<SqlException>() | |||||
.WaitAndRetry(10, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt))); | |||||
//if the sql server container is not created on run docker compose this | |||||
//migration can't fail for network related exception. The retry options for DbContext only | |||||
//apply to transient exceptions | |||||
// Note that this is NOT applied when running some orchestrators (let the orchestrator to recreate the failing service) | |||||
retry.Execute(() => InvokeSeeder(seeder, context, services)); | |||||
} | |||||
logger.LogInformation("Migrated database associated with context {DbContextName}", typeof(TContext).Name); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
logger.LogError(ex, "An error occurred while migrating the database used on context {DbContextName}", typeof(TContext).Name); | |||||
if (underK8s) | |||||
{ | |||||
throw; // Rethrow under k8s because we rely on k8s to re-run the pod | |||||
} | |||||
} | |||||
} | |||||
return host; | |||||
} | |||||
private static void InvokeSeeder<TContext>(Action<TContext, IServiceProvider> seeder, TContext context, IServiceProvider services) | |||||
where TContext : DbContext | |||||
{ | |||||
context.Database.Migrate(); | |||||
seeder(context, services); | |||||
} | |||||
} | |||||
} |
@ -0,0 +1,51 @@ | |||||
name: eshoponcontainers-servicesandwebapps | |||||
services: | |||||
- name: marketing-api | |||||
project: Marketing.API.csproj | |||||
env: | |||||
- name: ASPNETCORE_ENVIRONMENT | |||||
value: Development | |||||
- name: ASPNETCORE_URLS | |||||
value: http://0.0.0.0:80 | |||||
- name: ConnectionString | |||||
value: Server=localhost;Database=Microsoft.eShopOnContainers.Services.MarketingDb;User Id=sa;Password=Pass@word | |||||
- name: MongoConnectionString | |||||
value: mongodb://localhost:27017 | |||||
- name: MongoDatabase | |||||
value: MarketingDb | |||||
- name: identityUrl | |||||
value: http://localhost:5105 | |||||
- name: IdentityUrlExternal | |||||
value: http://localhost:5105 | |||||
- name: EventBusConnection | |||||
value: localhost | |||||
- name: EventBusUserName | |||||
value: | |||||
- name: EventBusPassword | |||||
value: | |||||
- name: CampaignDetailFunctionUri | |||||
value: | |||||
- name: PicBaseUrl | |||||
value: | |||||
- name: AzureStorageAccountName | |||||
value: | |||||
- name: AzureStorageAccountKey | |||||
value: | |||||
- name: AzureServiceBusEnabled | |||||
value: False | |||||
- name: AzureStorageEnabled | |||||
value: False | |||||
- name: ApplicationInsights__InstrumentationKey | |||||
value: | |||||
- name: OrchestratorType | |||||
value: | |||||
- name: UseLoadTest | |||||
value: False | |||||
- name: PATH_BASE | |||||
value: /marketing-api | |||||
bindings: | |||||
- name: http-port-80-binding | |||||
port: 5110 | |||||
protocol: http |
@ -0,0 +1,76 @@ | |||||
using Microsoft.EntityFrameworkCore; | |||||
using Microsoft.Extensions.Configuration; | |||||
using System; | |||||
using Microsoft.Extensions.DependencyInjection; | |||||
using Microsoft.Extensions.Logging; | |||||
using Polly; | |||||
using System.Data.SqlClient; | |||||
using Microsoft.AspNetCore.Hosting; | |||||
namespace Ordering.API.Extensions | |||||
{ | |||||
public static class WebHostExtensions | |||||
{ | |||||
public static bool IsInKubernetes(this IWebHost host) | |||||
{ | |||||
var cfg = host.Services.GetService<IConfiguration>(); | |||||
var orchestratorType = cfg.GetValue<string>("OrchestratorType"); | |||||
return orchestratorType?.ToUpper() == "K8S"; | |||||
} | |||||
public static IWebHost MigrateDbContext<TContext>(this IWebHost host, Action<TContext, IServiceProvider> seeder) where TContext : DbContext | |||||
{ | |||||
var underK8s = host.IsInKubernetes(); | |||||
using (var scope = host.Services.CreateScope()) | |||||
{ | |||||
var services = scope.ServiceProvider; | |||||
var logger = services.GetRequiredService<ILogger<TContext>>(); | |||||
var context = services.GetService<TContext>(); | |||||
try | |||||
{ | |||||
logger.LogInformation("Migrating database associated with context {DbContextName}", typeof(TContext).Name); | |||||
if (underK8s) | |||||
{ | |||||
InvokeSeeder(seeder, context, services); | |||||
} | |||||
else | |||||
{ | |||||
var retry = Policy.Handle<SqlException>() | |||||
.WaitAndRetry(10, retryAttempt => TimeSpan.FromSeconds(Math.Pow(2, retryAttempt))); | |||||
//if the sql server container is not created on run docker compose this | |||||
//migration can't fail for network related exception. The retry options for DbContext only | |||||
//apply to transient exceptions | |||||
// Note that this is NOT applied when running some orchestrators (let the orchestrator to recreate the failing service) | |||||
retry.Execute(() => InvokeSeeder(seeder, context, services)); | |||||
} | |||||
logger.LogInformation("Migrated database associated with context {DbContextName}", typeof(TContext).Name); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
logger.LogError(ex, "An error occurred while migrating the database used on context {DbContextName}", typeof(TContext).Name); | |||||
if (underK8s) | |||||
{ | |||||
throw; // Rethrow under k8s because we rely on k8s to re-run the pod | |||||
} | |||||
} | |||||
} | |||||
return host; | |||||
} | |||||
private static void InvokeSeeder<TContext>(Action<TContext, IServiceProvider> seeder, TContext context, IServiceProvider services) | |||||
where TContext : DbContext | |||||
{ | |||||
context.Database.Migrate(); | |||||
seeder(context, services); | |||||
} | |||||
} | |||||
} |
@ -0,0 +1,49 @@ | |||||
name: eshoponcontainers-servicesandwebapps | |||||
services: | |||||
- name: ordering-api | |||||
project: Ordering.API.csproj | |||||
env: | |||||
- name: ASPNETCORE_ENVIRONMENT | |||||
value: Development | |||||
- name: ASPNETCORE_URLS | |||||
value: http://0.0.0.0:80 | |||||
- name: ConnectionString | |||||
value: Server=localhost;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word | |||||
- name: identityUrl | |||||
value: http://localhost:5105 | |||||
- name: IdentityUrlExternal | |||||
value: http://localhost:5105 | |||||
- name: EventBusConnection | |||||
value: localhost | |||||
- name: EventBusUserName | |||||
value: | |||||
- name: EventBusPassword | |||||
value: | |||||
- name: UseCustomizationData | |||||
value: True | |||||
- name: AzureServiceBusEnabled | |||||
value: False | |||||
- name: CheckUpdateTime | |||||
value: 30000 | |||||
- name: ApplicationInsights__InstrumentationKey | |||||
value: | |||||
- name: OrchestratorType | |||||
value: | |||||
- name: UseLoadTest | |||||
value: False | |||||
- name: Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ | |||||
value: Verbose | |||||
- name: Serilog__MinimumLevel__Override__ordering-api | |||||
value: Verbose | |||||
- name: GRPC_PORT | |||||
value: 9102 | |||||
- name: PORT | |||||
value: 80 | |||||
- name: PATH_BASE | |||||
value: /ordering-api | |||||
bindings: | |||||
- name: http-port-80-binding | |||||
port: 5102 | |||||
protocol: http |
@ -0,0 +1,41 @@ | |||||
name: eshoponcontainers-servicesandwebapps | |||||
services: | |||||
- name: ordering-backgroundtasks | |||||
project: Ordering.BackgroundTasks.csproj | |||||
env: | |||||
- name: ASPNETCORE_ENVIRONMENT | |||||
value: Development | |||||
- name: ASPNETCORE_URLS | |||||
value: http://0.0.0.0:80 | |||||
- name: ConnectionString | |||||
value: Server=localhost;Database=Microsoft.eShopOnContainers.Services.OrderingDb;User Id=sa;Password=Pass@word | |||||
- name: identityUrl | |||||
value: http://localhost:5105 | |||||
- name: IdentityUrlExternal | |||||
value: http://localhost:5105 | |||||
- name: EventBusConnection | |||||
value: localhost | |||||
- name: EventBusUserName | |||||
value: | |||||
- name: EventBusPassword | |||||
value: | |||||
- name: UseCustomizationData | |||||
value: True | |||||
- name: AzureServiceBusEnabled | |||||
value: False | |||||
- name: CheckUpdateTime | |||||
value: 30000 | |||||
- name: ApplicationInsights__InstrumentationKey | |||||
value: | |||||
- name: OrchestratorType | |||||
value: | |||||
- name: UseLoadTest | |||||
value: False | |||||
- name: Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ | |||||
value: Verbose | |||||
bindings: | |||||
- name: http-port-80-binding | |||||
port: 5111 | |||||
protocol: http |
@ -0,0 +1,29 @@ | |||||
name: eshoponcontainers-servicesandwebapps | |||||
services: | |||||
- name: ordering-signalrhub | |||||
project: Ordering.SignalrHub.csproj | |||||
env: | |||||
- name: ASPNETCORE_ENVIRONMENT | |||||
value: Development | |||||
- name: ASPNETCORE_URLS | |||||
value: http://0.0.0.0:80 | |||||
- name: identityUrl | |||||
value: http://localhost:5105 | |||||
- name: EventBusConnection | |||||
value: localhost | |||||
- name: EventBusUserName | |||||
value: | |||||
- name: EventBusPassword | |||||
value: | |||||
- name: AzureServiceBusEnabled | |||||
value: False | |||||
- name: ApplicationInsights__InstrumentationKey | |||||
value: | |||||
- name: OrchestratorType | |||||
value: | |||||
bindings: | |||||
- name: http-port-80-binding | |||||
port: 5112 | |||||
protocol: http |
@ -0,0 +1,190 @@ | |||||
using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork; | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Linq; | |||||
using System.Text; | |||||
using Xunit; | |||||
namespace Ordering.UnitTests.Domain.SeedWork | |||||
{ | |||||
public class ValueObjectTests | |||||
{ | |||||
public ValueObjectTests() | |||||
{ } | |||||
[Theory] | |||||
[MemberData(nameof(EqualValueObjects))] | |||||
public void Equals_EqualValueObjects_ReturnsTrue(ValueObject instanceA, ValueObject instanceB, string reason) | |||||
{ | |||||
// Act | |||||
var result = EqualityComparer<ValueObject>.Default.Equals(instanceA, instanceB); | |||||
// Assert | |||||
Assert.True(result, reason); | |||||
} | |||||
[Theory] | |||||
[MemberData(nameof(NonEqualValueObjects))] | |||||
public void Equals_NonEqualValueObjects_ReturnsFalse(ValueObject instanceA, ValueObject instanceB, string reason) | |||||
{ | |||||
// Act | |||||
var result = EqualityComparer<ValueObject>.Default.Equals(instanceA, instanceB); | |||||
// Assert | |||||
Assert.False(result, reason); | |||||
} | |||||
private static readonly ValueObject APrettyValueObject = new ValueObjectA(1, "2", Guid.Parse("97ea43f0-6fef-4fb7-8c67-9114a7ff6ec0"), new ComplexObject(2, "3")); | |||||
public static readonly TheoryData<ValueObject, ValueObject, string> EqualValueObjects = new TheoryData<ValueObject, ValueObject, string> | |||||
{ | |||||
{ | |||||
null, | |||||
null, | |||||
"they should be equal because they are both null" | |||||
}, | |||||
{ | |||||
APrettyValueObject, | |||||
APrettyValueObject, | |||||
"they should be equal because they are the same object" | |||||
}, | |||||
{ | |||||
new ValueObjectA(1, "2", Guid.Parse("97ea43f0-6fef-4fb7-8c67-9114a7ff6ec0"), new ComplexObject(2, "3")), | |||||
new ValueObjectA(1, "2", Guid.Parse("97ea43f0-6fef-4fb7-8c67-9114a7ff6ec0"), new ComplexObject(2, "3")), | |||||
"they should be equal because they have equal members" | |||||
}, | |||||
{ | |||||
new ValueObjectA(1, "2", Guid.Parse("97ea43f0-6fef-4fb7-8c67-9114a7ff6ec0"), new ComplexObject(2, "3"), notAnEqualityComponent: "xpto"), | |||||
new ValueObjectA(1, "2", Guid.Parse("97ea43f0-6fef-4fb7-8c67-9114a7ff6ec0"), new ComplexObject(2, "3"), notAnEqualityComponent: "xpto2"), | |||||
"they should be equal because all equality components are equal, even though an additional member was set" | |||||
}, | |||||
{ | |||||
new ValueObjectB(1, "2", 1, 2, 3 ), | |||||
new ValueObjectB(1, "2", 1, 2, 3 ), | |||||
"they should be equal because all equality components are equal, including the 'C' list" | |||||
} | |||||
}; | |||||
public static readonly TheoryData<ValueObject, ValueObject, string> NonEqualValueObjects = new TheoryData<ValueObject, ValueObject, string> | |||||
{ | |||||
{ | |||||
new ValueObjectA(a: 1, b: "2", c: Guid.Parse("97ea43f0-6fef-4fb7-8c67-9114a7ff6ec0"), d: new ComplexObject(2, "3")), | |||||
new ValueObjectA(a: 2, b: "2", c: Guid.Parse("97ea43f0-6fef-4fb7-8c67-9114a7ff6ec0"), d: new ComplexObject(2, "3")), | |||||
"they should not be equal because the 'A' member on ValueObjectA is different among them" | |||||
}, | |||||
{ | |||||
new ValueObjectA(a: 1, b: "2", c: Guid.Parse("97ea43f0-6fef-4fb7-8c67-9114a7ff6ec0"), d: new ComplexObject(2, "3")), | |||||
new ValueObjectA(a: 1, b: null, c: Guid.Parse("97ea43f0-6fef-4fb7-8c67-9114a7ff6ec0"), d: new ComplexObject(2, "3")), | |||||
"they should not be equal because the 'B' member on ValueObjectA is different among them" | |||||
}, | |||||
{ | |||||
new ValueObjectA(a: 1, b: "2", c: Guid.Parse("97ea43f0-6fef-4fb7-8c67-9114a7ff6ec0"), d: new ComplexObject(a: 2, b: "3")), | |||||
new ValueObjectA(a: 1, b: "2", c: Guid.Parse("97ea43f0-6fef-4fb7-8c67-9114a7ff6ec0"), d: new ComplexObject(a: 3, b: "3")), | |||||
"they should not be equal because the 'A' member on ValueObjectA's 'D' member is different among them" | |||||
}, | |||||
{ | |||||
new ValueObjectA(a: 1, b: "2", c: Guid.Parse("97ea43f0-6fef-4fb7-8c67-9114a7ff6ec0"), d: new ComplexObject(a: 2, b: "3")), | |||||
new ValueObjectB(a: 1, b: "2"), | |||||
"they should not be equal because they are not of the same type" | |||||
}, | |||||
{ | |||||
new ValueObjectB(1, "2", 1, 2, 3 ), | |||||
new ValueObjectB(1, "2", 1, 2, 3, 4 ), | |||||
"they should be not be equal because the 'C' list contains one additional value" | |||||
}, | |||||
{ | |||||
new ValueObjectB(1, "2", 1, 2, 3, 5 ), | |||||
new ValueObjectB(1, "2", 1, 2, 3 ), | |||||
"they should be not be equal because the 'C' list contains one additional value" | |||||
}, | |||||
{ | |||||
new ValueObjectB(1, "2", 1, 2, 3, 5 ), | |||||
new ValueObjectB(1, "2", 1, 2, 3, 4 ), | |||||
"they should be not be equal because the 'C' lists are not equal" | |||||
} | |||||
}; | |||||
private class ValueObjectA : ValueObject | |||||
{ | |||||
public ValueObjectA(int a, string b, Guid c, ComplexObject d, string notAnEqualityComponent = null) | |||||
{ | |||||
A = a; | |||||
B = b; | |||||
C = c; | |||||
D = d; | |||||
NotAnEqualityComponent = notAnEqualityComponent; | |||||
} | |||||
public int A { get; } | |||||
public string B { get; } | |||||
public Guid C { get; } | |||||
public ComplexObject D { get; } | |||||
public string NotAnEqualityComponent { get; } | |||||
protected override IEnumerable<object> GetEqualityComponents() | |||||
{ | |||||
yield return A; | |||||
yield return B; | |||||
yield return C; | |||||
yield return D; | |||||
} | |||||
} | |||||
private class ValueObjectB : ValueObject | |||||
{ | |||||
public ValueObjectB(int a, string b, params int[] c) | |||||
{ | |||||
A = a; | |||||
B = b; | |||||
C = c.ToList(); | |||||
} | |||||
public int A { get; } | |||||
public string B { get; } | |||||
public List<int> C { get; } | |||||
protected override IEnumerable<object> GetEqualityComponents() | |||||
{ | |||||
yield return A; | |||||
yield return B; | |||||
foreach (var c in C) | |||||
{ | |||||
yield return c; | |||||
} | |||||
} | |||||
} | |||||
private class ComplexObject : IEquatable<ComplexObject> | |||||
{ | |||||
public ComplexObject(int a, string b) | |||||
{ | |||||
A = a; | |||||
B = b; | |||||
} | |||||
public int A { get; set; } | |||||
public string B { get; set; } | |||||
public override bool Equals(object obj) | |||||
{ | |||||
return Equals(obj as ComplexObject); | |||||
} | |||||
public bool Equals(ComplexObject other) | |||||
{ | |||||
return other != null && | |||||
A == other.A && | |||||
B == other.B; | |||||
} | |||||
public override int GetHashCode() | |||||
{ | |||||
return HashCode.Combine(A, B); | |||||
} | |||||
} | |||||
} | |||||
} |
@ -0,0 +1,31 @@ | |||||
name: eshoponcontainers-servicesandwebapps | |||||
services: | |||||
- name: payment-api | |||||
project: Payment.API.csproj | |||||
env: | |||||
- name: ASPNETCORE_ENVIRONMENT | |||||
value: Development | |||||
- name: ASPNETCORE_URLS | |||||
value: http://0.0.0.0:80 | |||||
- name: EventBusConnection | |||||
value: localhost | |||||
- name: EventBusUserName | |||||
value: | |||||
- name: EventBusPassword | |||||
value: | |||||
- name: AzureServiceBusEnabled | |||||
value: False | |||||
- name: ApplicationInsights__InstrumentationKey | |||||
value: | |||||
- name: OrchestratorType | |||||
value: | |||||
- name: Serilog__MinimumLevel__Override__payment-api.IntegrationEvents.EventHandling | |||||
value: Verbose | |||||
- name: Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ | |||||
value: Verbose | |||||
bindings: | |||||
- name: http-port-80-binding | |||||
port: 5108 | |||||
protocol: http |
@ -0,0 +1,27 @@ | |||||
name: eshoponcontainers-servicesandwebapps | |||||
services: | |||||
- name: webhooks-api | |||||
project: Webhooks.API.csproj | |||||
env: | |||||
- name: ASPNETCORE_ENVIRONMENT | |||||
value: Development | |||||
- name: ASPNETCORE_URLS | |||||
value: http://0.0.0.0:80 | |||||
- name: ConnectionString | |||||
value: Server=localhost;Database=Microsoft.eShopOnContainers.Services.WebhooksDb;User Id=sa;Password=Pass@word | |||||
- name: identityUrl | |||||
value: http://localhost:5105 | |||||
- name: IdentityUrlExternal | |||||
value: http://localhost:5105 | |||||
- name: EventBusConnection | |||||
value: localhost | |||||
- name: EventBusUserName | |||||
value: | |||||
- name: EventBusPassword | |||||
value: | |||||
bindings: | |||||
- name: http-port-80-binding | |||||
port: 5113 | |||||
protocol: http |
@ -1,12 +1,11 @@ | |||||
{ | { | ||||
"AzureServiceBusEnabled": false, | |||||
"ConnectionString": "Server=tcp:127.0.0.1,5433;Initial Catalog=Microsoft.eShopOnContainers.Services.MarketingDb;User Id=sa;Password=Pass@word", | "ConnectionString": "Server=tcp:127.0.0.1,5433;Initial Catalog=Microsoft.eShopOnContainers.Services.MarketingDb;User Id=sa;Password=Pass@word", | ||||
"MongoConnectionString": "mongodb://localhost:27017", | |||||
"MongoDatabase": "MarketingDb", | |||||
"EventBusConnection": "localhost", | |||||
"IdentityUrl": "http://localhost:5105", | "IdentityUrl": "http://localhost:5105", | ||||
"isTest": "true", | "isTest": "true", | ||||
"EventBusConnection": "localhost", | |||||
"AzureServiceBusEnabled": false, | |||||
"SubscriptionClientName": "Marketing", | |||||
"MongoConnectionString": "mongodb://localhost:27017", | |||||
"MongoDatabase": "MarketingDb", | |||||
"PicBaseUrl": "http://localhost:5110/api/v1/campaigns/[0]/pic/", | "PicBaseUrl": "http://localhost:5110/api/v1/campaigns/[0]/pic/", | ||||
"SubscriptionClientName": "Marketing" | "SubscriptionClientName": "Marketing" | ||||
} | } |
@ -0,0 +1,55 @@ | |||||
name: eshoponcontainers-servicesandwebapps | |||||
services: | |||||
- name: webmvc | |||||
project: WebMVC.csproj | |||||
env: | |||||
- name: ASPNETCORE_ENVIRONMENT | |||||
value: Development | |||||
- name: ASPNETCORE_URLS | |||||
value: http://0.0.0.0:80 | |||||
- name: IdentityUrl | |||||
value: http://localhost:5105 | |||||
- name: PurchaseUrl | |||||
value: http://localhost:5202 | |||||
- name: CatalogUrl | |||||
value: http://localhost:5101 | |||||
- name: BasketUrl | |||||
value: http://localhost:5103 | |||||
- name: OrderingUrl | |||||
value: http://localhost:5102 | |||||
- name: MarketingUrl | |||||
value: http://localhost:5203 | |||||
- name: CallBackUrl | |||||
value: http://localhost:5100/ | |||||
- name: LocationsUrl | |||||
value: http://localhost:5109/ | |||||
- name: SignalrHubUrl | |||||
value: http://localhost:5202 | |||||
- name: IdentityUrlHC | |||||
value: http://localhost:5105/hc | |||||
- name: IsClusterEnv | |||||
value: False | |||||
- name: UseResilientHttp | |||||
value: True | |||||
- name: UseLoadTest | |||||
value: False | |||||
- name: UseCustomizationData | |||||
value: False | |||||
- name: ActivateCampaignDetailFunction | |||||
value: False | |||||
- name: HttpClientRetryCount | |||||
value: 8 | |||||
- name: HttpClientExceptionsAllowedBeforeBreaking | |||||
value: 7 | |||||
- name: SessionCookieLifetimeMinutes | |||||
value: 60 | |||||
- name: ApplicationInsights__InstrumentationKey | |||||
value: | |||||
- name: OrchestratorType | |||||
value: | |||||
bindings: | |||||
- name: http-port-80-binding | |||||
port: 5100 | |||||
protocol: http |
@ -0,0 +1,31 @@ | |||||
name: eshoponcontainers-servicesandwebapps | |||||
services: | |||||
- name: webspa | |||||
project: WebSPA.csproj | |||||
env: | |||||
- name: ASPNETCORE_ENVIRONMENT | |||||
value: Development | |||||
- name: ASPNETCORE_URLS | |||||
value: http://0.0.0.0:80 | |||||
- name: IdentityUrl | |||||
value: http://localhost:5105 | |||||
- name: PurchaseUrl | |||||
value: http://localhost:5202 | |||||
- name: MarketingUrl | |||||
value: http://localhost:5203 | |||||
- name: IdentityUrlHC | |||||
value: http://localhost:5105/hc | |||||
- name: UseCustomizationData | |||||
value: True | |||||
- name: ApplicationInsights__InstrumentationKey | |||||
value: | |||||
- name: OrchestratorType | |||||
value: | |||||
- name: SignalrHubUrl | |||||
value: http://localhost:5202 | |||||
bindings: | |||||
- name: http-port-80-binding | |||||
port: 5104 | |||||
protocol: http |
@ -0,0 +1,71 @@ | |||||
name: eshoponcontainers-servicesandwebapps | |||||
services: | |||||
- name: webstatus | |||||
project: WebStatus.csproj | |||||
env: | |||||
- name: ASPNETCORE_ENVIRONMENT | |||||
value: Development | |||||
- name: ASPNETCORE_URLS | |||||
value: http://0.0.0.0:80 | |||||
- name: HealthChecksUI__HealthChecks__0__Name | |||||
value: WebMVC HTTP Check | |||||
- name: HealthChecksUI__HealthChecks__0__Uri | |||||
value: http://localhost:5100/hc | |||||
- name: HealthChecksUI__HealthChecks__1__Name | |||||
value: WebSPA HTTP Check | |||||
- name: HealthChecksUI__HealthChecks__1__Uri | |||||
value: http://localhost:5104/hc | |||||
- name: HealthChecksUI__HealthChecks__2__Name | |||||
value: Web Shopping Aggregator GW HTTP Check | |||||
- name: HealthChecksUI__HealthChecks__2__Uri | |||||
value: http://localhost:5121/hc | |||||
- name: HealthChecksUI__HealthChecks__3__Name | |||||
value: Mobile Shopping Aggregator HTTP Check | |||||
- name: HealthChecksUI__HealthChecks__3__Uri | |||||
value: http://localhost:5120/hc | |||||
- name: HealthChecksUI__HealthChecks__4__Name | |||||
value: Ordering HTTP Check | |||||
- name: HealthChecksUI__HealthChecks__4__Uri | |||||
value: http://localhost:5102/hc | |||||
- name: HealthChecksUI__HealthChecks__5__Name | |||||
value: Basket HTTP Check | |||||
- name: HealthChecksUI__HealthChecks__5__Uri | |||||
value: http://localhost:5103/hc | |||||
- name: HealthChecksUI__HealthChecks__6__Name | |||||
value: Catalog HTTP Check | |||||
- name: HealthChecksUI__HealthChecks__6__Uri | |||||
value: http://localhost:5101/hc | |||||
- name: HealthChecksUI__HealthChecks__7__Name | |||||
value: Identity HTTP Check | |||||
- name: HealthChecksUI__HealthChecks__7__Uri | |||||
value: http://localhost:5105/hc | |||||
- name: HealthChecksUI__HealthChecks__8__Name | |||||
value: Marketing HTTP Check | |||||
- name: HealthChecksUI__HealthChecks__8__Uri | |||||
value: http://localhost:5110/hc | |||||
- name: HealthChecksUI__HealthChecks__9__Name | |||||
value: Locations HTTP Check | |||||
- name: HealthChecksUI__HealthChecks__9__Uri | |||||
value: http://localhost:5109/hc | |||||
- name: HealthChecksUI__HealthChecks__10__Name | |||||
value: Payments HTTP Check | |||||
- name: HealthChecksUI__HealthChecks__10__Uri | |||||
value: http://localhost:5108/hc | |||||
- name: HealthChecksUI__HealthChecks__11__Name | |||||
value: Ordering SignalRHub HTTP Check | |||||
- name: HealthChecksUI__HealthChecks__11__Uri | |||||
value: http://localhost:5112/hc | |||||
- name: HealthChecksUI__HealthChecks__12__Name | |||||
value: Ordering HTTP Background Check | |||||
- name: HealthChecksUI__HealthChecks__12__Uri | |||||
value: http://localhost:5111/hc | |||||
- name: ApplicationInsights__InstrumentationKey | |||||
value: | |||||
- name: OrchestratorType | |||||
value: | |||||
bindings: | |||||
- name: http-port-80-binding | |||||
port: 5107 | |||||
protocol: http |
@ -0,0 +1,25 @@ | |||||
name: eshoponcontainers-servicesandwebapps | |||||
services: | |||||
- name: webhooks-client | |||||
project: WebhookClient.csproj | |||||
env: | |||||
- name: ASPNETCORE_ENVIRONMENT | |||||
value: Development | |||||
- name: ASPNETCORE_URLS | |||||
value: http://0.0.0.0:80 | |||||
- name: Token | |||||
value: 6168DB8D-DC58-4094-AF24-483278923590 | |||||
- name: IdentityUrl | |||||
value: http://localhost:5105 | |||||
- name: CallBackUrl | |||||
value: http://localhost:5114 | |||||
- name: WebhooksUrl | |||||
value: http://localhost:5113 | |||||
- name: SelfUrl | |||||
value: http://localhost:5114/ | |||||
bindings: | |||||
- name: http-port-80-binding | |||||
port: 5114 | |||||
protocol: http |
@ -0,0 +1,151 @@ | |||||
name: eshoponcontainers-servicesandwebapps | |||||
extensions: | |||||
- name: zipkin | |||||
services: | |||||
- name: sqldata | |||||
image: mcr.microsoft.com/mssql/server:2017-latest | |||||
bindings: | |||||
- port: 1433 | |||||
containerPort: 1433 | |||||
env: | |||||
- name: ACCEPT_EULA | |||||
value: Y | |||||
- name: SA_PASSWORD | |||||
value: Pass@word | |||||
- name: nosqldata | |||||
image: mongo | |||||
bindings: | |||||
- port: 27017 | |||||
containerPort: 27017 | |||||
- name: basketdata | |||||
image: redis:alpine | |||||
bindings: | |||||
- port: 6379 | |||||
containerPort: 6379 | |||||
- name: rabbitmq | |||||
image: rabbitmq:3-management-alpine | |||||
bindings: | |||||
- name: http-binding | |||||
port: 15672 | |||||
containerPort: 15672 | |||||
- name: amqp-binding | |||||
port: 5672 | |||||
containerPort: 5672 | |||||
- name: seq | |||||
image: datalust/seq:latest | |||||
bindings: | |||||
- port: 5340 | |||||
containerPort: 80 | |||||
env: | |||||
- name: ACCEPT_EULA | |||||
value: Y | |||||
- name: identity-api | |||||
include: Services/Identity/Identity.API/tye.yaml | |||||
- name: catalog-api | |||||
include: Services/Catalog/Catalog.API/tye.yaml | |||||
- name: basket-api | |||||
include: Services/Basket/Basket.API/tye.yaml | |||||
- name: ordering-api | |||||
include: Services/Ordering/Ordering.API/tye.yaml | |||||
- name: ordering-backgroundtasks | |||||
include: Services/Ordering/Ordering.BackgroundTasks/tye.yaml | |||||
- name: marketing-api | |||||
include: Services/Marketing/Marketing.API/tye.yaml | |||||
- name: payment-api | |||||
include: Services/Payment/Payment.API/tye.yaml | |||||
- name: locations-api | |||||
include: Services/Location/Locations.API/tye.yaml | |||||
- name: webhooks-api | |||||
include: Services/Webhooks/Webhooks.API/tye.yaml | |||||
- name: mobileshoppingapigw | |||||
image: envoyproxy/envoy:v1.11.1 | |||||
bindings: | |||||
- name: http-port-80-binding | |||||
port: 5200 | |||||
containerPort: 80 | |||||
- name: http-port-8001-binding | |||||
port: 15200 | |||||
containerPort: 8001 | |||||
volumes: | |||||
- source: ./ApiGateways/Envoy/config/mobileshopping | |||||
target: /etc/envoy | |||||
- name: mobilemarketingapigw | |||||
image: envoyproxy/envoy:v1.11.1 | |||||
bindings: | |||||
- name: http-port-80-binding | |||||
port: 5201 | |||||
containerPort: 80 | |||||
- name: http-port-8001-binding | |||||
port: 15201 | |||||
containerPort: 8001 | |||||
volumes: | |||||
- source: ./ApiGateways/Envoy/config/mobilemarketing | |||||
target: /etc/envoy | |||||
- name: webshoppingapigw | |||||
image: envoyproxy/envoy:v1.11.1 | |||||
bindings: | |||||
- name: http-port-80-binding | |||||
port: 5202 | |||||
containerPort: 80 | |||||
- name: http-port-8001-binding | |||||
port: 15202 | |||||
containerPort: 8001 | |||||
volumes: | |||||
- source: ./ApiGateways/Envoy/tye-config/webshopping | |||||
target: /etc/envoy | |||||
- name: webmarketingapigw | |||||
image: envoyproxy/envoy:v1.11.1 | |||||
bindings: | |||||
- name: http-port-80-binding | |||||
port: 5203 | |||||
containerPort: 80 | |||||
- name: http-port-8001-binding | |||||
port: 15203 | |||||
containerPort: 8001 | |||||
volumes: | |||||
- source: ./ApiGateways/Envoy/tye-config/webmarketing | |||||
target: /etc/envoy | |||||
- name: mobileshoppingagg | |||||
include: ApiGateways/Mobile.Bff.Shopping/aggregator/tye.yaml | |||||
- name: webshoppingagg | |||||
include: ApiGateways/Web.Bff.Shopping/aggregator/tye.yaml | |||||
- name: ordering-signalrhub | |||||
include: Services/Ordering/Ordering.SignalrHub/tye.yaml | |||||
- name: webstatus | |||||
include: Web/WebStatus/tye.yaml | |||||
- name: webmvc | |||||
include: Web/WebMVC/tye.yaml | |||||
- name: webspa | |||||
include: Web/WebSPA/tye.yaml | |||||
- name: webhooks-client | |||||
include: Web/WebhookClient/tye.yaml |