Browse Source

Merge pull request #50 from dotnet-architecture/dev

eShopOnContainers fork
pull/1934/head
Taras Kovalenko 5 years ago
committed by GitHub
parent
commit
4d76ba42aa
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
140 changed files with 2146 additions and 280 deletions
  1. +6
    -1
      .gitignore
  2. +15
    -60
      README.md
  3. +63
    -33
      build/azure-devops/apigws/azure-pipelines.yml
  4. +26
    -0
      build/multiarch-manifests/create-manifests.ps1
  5. +20
    -20
      docker-compose.yml
  6. +0
    -8
      docker-scripts/linux/install-node.sh
  7. +0
    -4
      docker-scripts/win/install-node.cmd
  8. +56
    -2
      eShopOnContainers-ServicesAndWebApps.sln
  9. +5
    -6
      k8s/helm/apigwmm/templates/_names.tpl
  10. +2
    -2
      k8s/helm/apigwmm/templates/deployment.yaml
  11. +6
    -3
      k8s/helm/apigwmm/templates/ingress.yaml
  12. +2
    -0
      k8s/helm/apigwmm/values.yaml
  13. +4
    -6
      k8s/helm/apigwms/templates/_names.tpl
  14. +2
    -2
      k8s/helm/apigwms/templates/deployment.yaml
  15. +7
    -3
      k8s/helm/apigwms/templates/ingress.yaml
  16. +3
    -1
      k8s/helm/apigwms/values.yaml
  17. +4
    -6
      k8s/helm/apigwwm/templates/_names.tpl
  18. +2
    -2
      k8s/helm/apigwwm/templates/deployment.yaml
  19. +7
    -3
      k8s/helm/apigwwm/templates/ingress.yaml
  20. +3
    -1
      k8s/helm/apigwwm/values.yaml
  21. +5
    -6
      k8s/helm/apigwws/templates/_names.tpl
  22. +2
    -2
      k8s/helm/apigwws/templates/deployment.yaml
  23. +6
    -3
      k8s/helm/apigwws/templates/ingress.yaml
  24. +2
    -0
      k8s/helm/apigwws/values.yaml
  25. +37
    -0
      k8s/helm/basket-api/templates/ingress.yaml
  26. +3
    -0
      k8s/helm/basket-api/values.yaml
  27. +37
    -0
      k8s/helm/catalog-api/templates/ingress.yaml
  28. +18
    -9
      k8s/helm/deploy-all.ps1
  29. +1
    -2
      k8s/helm/identity-api/templates/configmap.yaml
  30. +5
    -2
      k8s/helm/identity-api/templates/ingress.yaml
  31. +6
    -1
      k8s/helm/identity-api/values.yaml
  32. +36
    -0
      k8s/helm/locations-api/templates/ingress.yaml
  33. +36
    -0
      k8s/helm/marketing-api/templates/ingress.yaml
  34. +36
    -0
      k8s/helm/mobileshoppingagg/templates/ingress.yaml
  35. +2
    -1
      k8s/helm/ordering-backgroundtasks/templates/configmap.yaml
  36. +2
    -2
      k8s/helm/ordering-backgroundtasks/templates/deployment.yaml
  37. +5
    -2
      k8s/helm/webhooks-api/templates/ingress.yaml
  38. +0
    -1
      k8s/helm/webmvc/templates/configmap.yaml
  39. +5
    -2
      k8s/helm/webmvc/templates/ingress.yaml
  40. +36
    -0
      k8s/helm/webshoppingagg/templates/ingress.yaml
  41. +14
    -0
      src/ApiGateways/ApiGw-Base/Dockerfile.develop
  42. +44
    -0
      src/ApiGateways/Mobile.Bff.Marketing/apigw/azds.yaml
  43. +2
    -0
      src/ApiGateways/Mobile.Bff.Marketing/apigw/values.dev.yaml
  44. +16
    -0
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop
  45. +4
    -0
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj
  46. +7
    -0
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Properties/launchSettings.json
  47. +8
    -3
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs
  48. +55
    -0
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml
  49. +3
    -0
      src/ApiGateways/Mobile.Bff.Shopping/aggregator/values.dev.yaml
  50. +44
    -0
      src/ApiGateways/Mobile.Bff.Shopping/apigw/azds.yaml
  51. +2
    -0
      src/ApiGateways/Mobile.Bff.Shopping/apigw/values.dev.yaml
  52. +44
    -0
      src/ApiGateways/Web.Bff.Marketing/apigw/azds.yaml
  53. +2
    -0
      src/ApiGateways/Web.Bff.Marketing/apigw/values.dev.yaml
  54. +16
    -0
      src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile.develop
  55. +9
    -5
      src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs
  56. +4
    -0
      src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj
  57. +55
    -0
      src/ApiGateways/Web.Bff.Shopping/aggregator/azds.yaml
  58. +2
    -0
      src/ApiGateways/Web.Bff.Shopping/aggregator/values.dev.yaml
  59. +43
    -0
      src/ApiGateways/Web.Bff.Shopping/apigw/azds.yaml
  60. +2
    -0
      src/ApiGateways/Web.Bff.Shopping/apigw/values.dev.yaml
  61. +11
    -0
      src/BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj
  62. +30
    -0
      src/BuildingBlocks/Devspaces.Support/DevspacesMessageHandler.cs
  63. +16
    -0
      src/BuildingBlocks/Devspaces.Support/HttpClientBuilderDevspacesExtensions.cs
  64. +16
    -0
      src/BuildingBlocks/Devspaces.Support/ServiceCollectionDevspacesExtensions.cs
  65. +33
    -14
      src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs
  66. +14
    -0
      src/Services/Basket/Basket.API/.dockerignore
  67. +2
    -2
      src/Services/Basket/Basket.API/Controllers/BasketController.cs
  68. +19
    -0
      src/Services/Basket/Basket.API/Dockerfile.develop
  69. +2
    -1
      src/Services/Basket/Basket.API/Startup.cs
  70. +56
    -0
      src/Services/Basket/Basket.API/azds.yaml
  71. +3
    -0
      src/Services/Basket/Basket.API/values.dev.yaml
  72. +2
    -0
      src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj
  73. +2
    -2
      src/Services/Basket/Basket.UnitTests/Application/BasketWebApiTest.cs
  74. +2
    -0
      src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj
  75. +9
    -0
      src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs
  76. +21
    -0
      src/Services/Catalog/Catalog.API/Dockerfile.develop
  77. +1
    -1
      src/Services/Catalog/Catalog.API/Model/CatalogItem.cs
  78. +7
    -0
      src/Services/Catalog/Catalog.API/Properties/launchSettings.json
  79. +2
    -1
      src/Services/Catalog/Catalog.API/Startup.cs
  80. +54
    -0
      src/Services/Catalog/Catalog.API/azds.yaml
  81. +3
    -0
      src/Services/Catalog/Catalog.API/values.dev.yaml
  82. +2
    -0
      src/Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj
  83. +2
    -0
      src/Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj
  84. +14
    -0
      src/Services/Identity/Identity.API/.dockerignore
  85. +31
    -0
      src/Services/Identity/Identity.API/Devspaces/DevspacesRedirectUriValidator.cs
  86. +20
    -0
      src/Services/Identity/Identity.API/Devspaces/IdentityDevspacesBuilderExtensions.cs
  87. +15
    -0
      src/Services/Identity/Identity.API/Dockerfile.develop
  88. +2
    -2
      src/Services/Identity/Identity.API/README.md
  89. +2
    -0
      src/Services/Identity/Identity.API/Startup.cs
  90. +3
    -3
      src/Services/Identity/Identity.API/Views/Consent/Index.cshtml
  91. +1
    -1
      src/Services/Identity/Identity.API/Views/Shared/_LoginPartial.cshtml
  92. +56
    -0
      src/Services/Identity/Identity.API/azds.yaml
  93. +1
    -0
      src/Services/Identity/Identity.API/values.dev.yaml
  94. +17
    -0
      src/Services/Location/Locations.API/Dockerfile.develop
  95. +2
    -1
      src/Services/Location/Locations.API/Startup.cs
  96. +56
    -0
      src/Services/Location/Locations.API/azds.yaml
  97. +3
    -0
      src/Services/Location/Locations.API/values.dev.yaml
  98. +2
    -0
      src/Services/Location/Locations.FunctionalTests/Locations.FunctionalTests.csproj
  99. +18
    -0
      src/Services/Marketing/Marketing.API/Dockerfile.develop
  100. +2
    -1
      src/Services/Marketing/Marketing.API/Startup.cs

+ 6
- 1
.gitignore View File

@ -269,4 +269,9 @@ pub/
.mfractor
# Ignore HealthCheckdb
*healthchecksdb*
*healthchecksdb*
# Ignores all extra inf.yaml and app.yaml that are copied by prepare-devspaces.ps1
src/**/app.yaml
src/**/inf.yaml

+ 15
- 60
README.md View File

@ -1,70 +1,25 @@
# eShopOnContainers - Microservices Architecture and Containers based Reference Application (**BETA state** - Visual Studio 2017 and CLI environments compatible)
# eShopOnContainers - Microservices Architecture and Containers based Reference Application (**BETA state** - Visual Studio and CLI environments compatible)
Sample .NET Core reference application, powered by Microsoft, based on a simplified microservices architecture and Docker containers.
## Linux Build Status for 'dev' branch
Dev branch contains the latest "stable" code, and their images are tagged with `:dev` in our [Docker Hub](https://cloud.docker.com/u/eshop/repository/list):
Api Gateways base image
| Basket API | Catalog API | Identity API | Location API |
| ------------- | ------------- | ------------- | ------------- |
| [![Basket API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/basket?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=199&branchName=dev) | [![Catalog API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/catalog?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=197&branchName=dev) | [![Identity API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/identity?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=200&branchName=dev) | [![Location API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/location?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=202&branchName=dev) |
[![Api Gateways base image](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/apigws?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=201&branchName=dev)
| Marketing API | Ordering API | Payment API | Api Gateways base image |
| ------------- | ------------- | ------------- | ------------- |
| [![Marketing API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/marketing?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=203&branchName=dev) | [![Ordering API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/ordering?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=198&branchName=dev) | [![Payment API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/payment?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=205&branchName=dev) | [![Api Gateways base image](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/apigws?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=201&branchName=dev)
Basket API
[![Basket API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/basket?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=199&branchName=dev)
Catalog API
[![Catalog API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/catalog?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=197&branchName=dev)
Identity API
[![Identity API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/identity?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=200&branchName=dev)
Location API
[![Location API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/location?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=202&branchName=dev)
Marketing API
[![Marketing API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/marketing?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=203&branchName=dev)
Ordering API
[![Ordering API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/ordering?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=198&branchName=dev)
Payment API
[![Payment API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/payment?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=205&branchName=dev)
Webhooks API
[![Webhooks API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webhooks?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=207&branchName=dev)
Web Shopping Aggregator
[![Web Shopping Aggregator](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/web-shopping-agg?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=206&branchName=dev)
Mobile Shopping Aggregator
[![Mobile Shopping Aggregator](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/mobile-shopping-agg?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=204&branchName=dev)
Webbhooks demo client
[![Webhooks demo client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webhooks-client?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=208&branchName=dev)
WebMVC Client
[![WebMVC Client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webmvc?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=209&branchName=dev)
WebSPA Client
[![WebSPA Client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webspa?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=210&branchName=dev)
Web Status
[![Web Status](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webstatus?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=211&branchName=dev)
| Web Shopping Aggregator | Mobile Shopping Aggregator | WebMVC Client | WebSPA Client |
| ------------- | ------------- | ------------- | ------------- |
| [![Web Shopping Aggregator](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/web-shopping-agg?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=206&branchName=dev) | [![Mobile Shopping Aggregator](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/mobile-shopping-agg?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=204&branchName=dev) | [![WebMVC Client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webmvc?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=209&branchName=dev) | [![WebSPA Client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webspa?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=210&branchName=dev) |
| Web Status | Webhooks API | Webbhooks demo client |
| ------------- | ------------- | ------------- |
[![Web Status](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webstatus?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=211&branchName=dev) | [![Webhooks API](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webhooks?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=207&branchName=dev) | [![Webhooks demo client](https://msftdevtools.visualstudio.com/eShopOnContainers/_apis/build/status/microservices/webhooks-client?branchName=dev)](https://msftdevtools.visualstudio.com/eShopOnContainers/_build/latest?definitionId=208&branchName=dev) |
## IMPORTANT NOTES!
**You can use either the latest version of Visual Studio or simply Docker CLI and .NET CLI for Windows, Mac and Linux**.
@ -174,7 +129,7 @@ Finally, those microservices are consumed by multiple client web and mobile apps
<img src="img/xamarin-mobile-App.png">
## Setting up your development environment for eShopOnContainers
### Visual Studio 2017 and Windows based
### Visual Studio 2017 (or above) and Windows based
This is the more straightforward way to get started:
https://github.com/dotnet-architecture/eShopOnContainers/wiki/02.-Setting-eShopOnContainers-in-a-Visual-Studio-2017-environment
@ -194,5 +149,5 @@ As mentioned, we'd appreciate your feedback, improvements and ideas.
You can create new issues at the issues section, do pull requests and/or send emails to **eshop_feedback@service.microsoft.com**
## Questions
[QUESTION] Answer +1 if the solution is working for you (Through VS2017 or CLI environment):
[QUESTION] Answer +1 if the solution is working for you (Through VS or CLI environment):
https://github.com/dotnet/eShopOnContainers/issues/107

+ 63
- 33
build/azure-devops/apigws/azure-pipelines.yml View File

@ -1,5 +1,3 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
@ -17,34 +15,66 @@ trigger:
exclude:
- src/ApiGateways/Mobile.Bff.Shopping/aggregator/*
- src/ApiGateways/Web.Bff.Shopping/aggregator/*
steps:
- task: DockerCompose@0
displayName: Compose build apigws
inputs:
dockerComposeCommand: 'build mobileshoppingapigw mobilemarketingapigw webshoppingapigw webmarketingapigw'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push apigws
inputs:
dockerComposeCommand: 'push mobileshoppingapigw mobilemarketingapigw webshoppingapigw webmarketingapigw'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)/k8s/helm
targetFolder: $(Build.ArtifactStagingDirectory)/k8s/helm
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/k8s/helm
artifactName: helm
jobs:
- job: BuildLinux
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: DockerCompose@0
displayName: Compose build apigws
inputs:
dockerComposeCommand: 'build mobileshoppingapigw mobilemarketingapigw webshoppingapigw webmarketingapigw'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push apigws
inputs:
dockerComposeCommand: 'push mobileshoppingapigw mobilemarketingapigw webshoppingapigw webmarketingapigw'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: CopyFiles@2
inputs:
sourceFolder: $(Build.SourcesDirectory)/k8s/helm
targetFolder: $(Build.ArtifactStagingDirectory)/k8s/helm
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)/k8s/helm
artifactName: helm
- job: BuildWindows
pool:
vmImage: 'vs2017-win2016'
steps:
- task: DockerCompose@0
displayName: Compose build apigws
inputs:
dockerComposeCommand: 'build mobileshoppingapigw mobilemarketingapigw webshoppingapigw webmarketingapigw'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
PLATFORM=win
- task: DockerCompose@0
displayName: Compose push apigws
inputs:
dockerComposeCommand: 'push mobileshoppingapigw mobilemarketingapigw webshoppingapigw webmarketingapigw'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
PLATFORM=win

+ 26
- 0
build/multiarch-manifests/create-manifests.ps1 View File

@ -0,0 +1,26 @@
Param(
[parameter(Mandatory=$true)][string]$registry
)
if ([String]::IsNullOrEmpty($registry)) {
Write-Host "Registry must be set to docker registry to use" -ForegroundColor Red
exit 1
}
Write-Host "This script creates the local manifests, for pushing the multi-arch manifests" -ForegroundColor Yellow
Write-Host "Tags used are linux-master, win-master, linux-dev, win-dev, linux-latest, win-latest" -ForegroundColor Yellow
Write-Host "Multiarch images tags will be master, dev, latest" -ForegroundColor Yellow
$services = "identity.api", "basket.api", "catalog.api", "ordering.api", "ordering.backgroundtasks", "marketing.api", "payment.api", "locations.api", "webhooks.api", "ocelotapigw", "mobileshoppingagg", "webshoppingagg", "ordering.signalrhub", "webstatus", "webspa", "webmvc", "webhooks.client"
foreach ($svc in $services) {
Write-Host "Creating manifest for $svc and tags :latest, :master, and :dev"
docker manifest create $registry/${svc}:master $registry/${svc}:linux-master $registry/${svc}:win-master
docker manifest create $registry/${svc}:dev $registry/${svc}:linux-dev $registry/${svc}:win-dev
docker manifest create $registry/${svc}:latest $registry/${svc}:linux-latest $registry/${svc}:win-latest
Write-Host "Pushing manifest for $svc and tags :latest, :master, and :dev"
docker manifest push $registry/${svc}:latest
docker manifest push $registry/${svc}:dev
docker manifest push $registry/${svc}:master
}

+ 20
- 20
docker-compose.yml View File

@ -18,7 +18,7 @@ services:
image: rabbitmq:3-management-alpine
identity.api:
image: ${REGISTRY:-eshop}/identity.api:${TAG:-latest}
image: ${REGISTRY:-eshop}/identity.api:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: src/Services/Identity/Identity.API/Dockerfile
@ -26,7 +26,7 @@ services:
- sql.data
basket.api:
image: ${REGISTRY:-eshop}/basket.api:${TAG:-latest}
image: ${REGISTRY:-eshop}/basket.api:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: src/Services/Basket/Basket.API/Dockerfile
@ -36,7 +36,7 @@ services:
- rabbitmq
catalog.api:
image: ${REGISTRY:-eshop}/catalog.api:${TAG:-latest}
image: ${REGISTRY:-eshop}/catalog.api:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: src/Services/Catalog/Catalog.API/Dockerfile
@ -45,7 +45,7 @@ services:
- rabbitmq
ordering.api:
image: ${REGISTRY:-eshop}/ordering.api:${TAG:-latest}
image: ${REGISTRY:-eshop}/ordering.api:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: src/Services/Ordering/Ordering.API/Dockerfile
@ -54,7 +54,7 @@ services:
- rabbitmq
ordering.backgroundtasks:
image: ${REGISTRY:-eshop}/ordering.backgroundtasks:${TAG:-latest}
image: ${REGISTRY:-eshop}/ordering.backgroundtasks:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: src/Services/Ordering/Ordering.BackgroundTasks/Dockerfile
@ -63,7 +63,7 @@ services:
- rabbitmq
marketing.api:
image: ${REGISTRY:-eshop}/marketing.api:${TAG:-latest}
image: ${REGISTRY:-eshop}/marketing.api:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: src/Services/Marketing/Marketing.API/Dockerfile
@ -74,7 +74,7 @@ services:
- rabbitmq
payment.api:
image: ${REGISTRY:-eshop}/payment.api:${TAG:-latest}
image: ${REGISTRY:-eshop}/payment.api:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: src/Services/Payment/Payment.API/Dockerfile
@ -82,7 +82,7 @@ services:
- rabbitmq
locations.api:
image: ${REGISTRY:-eshop}/locations.api:${TAG:-latest}
image: ${REGISTRY:-eshop}/locations.api:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: src/Services/Location/Locations.API/Dockerfile
@ -91,7 +91,7 @@ services:
- rabbitmq
webhooks.api:
image: ${REGISTRY:-eshop}/webhooks.api:${TAG:-latest}
image: ${REGISTRY:-eshop}/webhooks.api:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: src/Services/Webhooks/Webhooks.API/Dockerfile
@ -99,7 +99,7 @@ services:
- sql.data
mobileshoppingapigw:
image: ${REGISTRY:-eshop}/ocelotapigw:${TAG:-latest}
image: ${REGISTRY:-eshop}/ocelotapigw:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: src/ApiGateways/ApiGw-Base/Dockerfile
@ -114,7 +114,7 @@ services:
- basket.api
mobilemarketingapigw:
image: ${REGISTRY:-eshop}/ocelotapigw:${TAG:-latest}
image: ${REGISTRY:-eshop}/ocelotapigw:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: src/ApiGateways/ApiGw-Base/Dockerfile
@ -129,7 +129,7 @@ services:
- basket.api
webshoppingapigw:
image: ${REGISTRY:-eshop}/ocelotapigw:${TAG:-latest}
image: ${REGISTRY:-eshop}/ocelotapigw:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: src/ApiGateways/ApiGw-Base/Dockerfile
@ -144,7 +144,7 @@ services:
- basket.api
webmarketingapigw:
image: ${REGISTRY:-eshop}/ocelotapigw:${TAG:-latest}
image: ${REGISTRY:-eshop}/ocelotapigw:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: src/ApiGateways/ApiGw-Base/Dockerfile
@ -159,7 +159,7 @@ services:
- basket.api
mobileshoppingagg:
image: ${REGISTRY:-eshop}/mobileshoppingagg:${TAG:-latest}
image: ${REGISTRY:-eshop}/mobileshoppingagg:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile
@ -174,7 +174,7 @@ services:
- basket.api
webshoppingagg:
image: ${REGISTRY:-eshop}/webshoppingagg:${TAG:-latest}
image: ${REGISTRY:-eshop}/webshoppingagg:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile
@ -189,7 +189,7 @@ services:
- basket.api
ordering.signalrhub:
image: ${REGISTRY:-eshop}/ordering.signalrhub:${TAG:-latest}
image: ${REGISTRY:-eshop}/ordering.signalrhub:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: src/Services/Ordering/Ordering.SignalrHub/Dockerfile
@ -204,13 +204,13 @@ services:
- basket.api
webstatus:
image: ${REGISTRY:-eshop}/webstatus:${TAG:-latest}
image: ${REGISTRY:-eshop}/webstatus:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: src/Web/WebStatus/Dockerfile
webspa:
image: ${REGISTRY:-eshop}/webspa:${TAG:-latest}
image: ${REGISTRY:-eshop}/webspa:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: src/Web/WebSPA/Dockerfile
@ -220,7 +220,7 @@ services:
# - webmarketingapigw
webmvc:
image: ${REGISTRY:-eshop}/webmvc:${TAG:-latest}
image: ${REGISTRY:-eshop}/webmvc:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: src/Web/WebMVC/Dockerfile
@ -230,7 +230,7 @@ services:
- webmarketingapigw
webhooks.client:
image: ${REGISTRY:-eshop}/webhooks.client:${TAG:-latest}
image: ${REGISTRY:-eshop}/webhooks.client:${PLATFORM:-linux}-${TAG:-latest}
build:
context: .
dockerfile: src/Web/WebhookClient/Dockerfile


+ 0
- 8
docker-scripts/linux/install-node.sh View File

@ -1,8 +0,0 @@
#!/bin/sh
export NODE_DOWNLOAD_SHA 0e20787e2eda4cc31336d8327556ebc7417e8ee0a6ba0de96a09b0ec2b841f60
curl -SL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.gz" --output nodejs.tar.gz \
&& echo "$NODE_DOWNLOAD_SHA nodejs.tar.gz" | sha256sum -c - \
&& tar -xzf "nodejs.tar.gz" -C /usr/local --strip-components=1 \
&& rm nodejs.tar.gz \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs

+ 0
- 4
docker-scripts/win/install-node.cmd View File

@ -1,4 +0,0 @@
set NODE_VERSION=8.11.1
curl -SL "https://nodejs.org/dist/v%NODE_VERSION%/node-v%NODE_VERSION%-win-x64.zip" --output nodejs.zip
tar -xf nodejs.zip -C c:\
setx PATH "%PATH%;c:\node-v%NODE_VERSION%-win-x64"

+ 56
- 2
eShopOnContainers-ServicesAndWebApps.sln View File

@ -142,9 +142,13 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Payment.API", "src\Services
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Webhooks", "Webhooks", "{E0AA11C4-2873-461D-8F82-53392530FB7A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Webhooks.API", "src\Services\Webhooks\Webhooks.API\Webhooks.API.csproj", "{84E2016E-0435-44C6-8020-3D288AA38B2C}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Webhooks.API", "src\Services\Webhooks\Webhooks.API\Webhooks.API.csproj", "{84E2016E-0435-44C6-8020-3D288AA38B2C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebhookClient", "src\Web\WebhookClient\WebhookClient.csproj", "{766D7E92-6AF0-476C-ADD5-282BF4D8C576}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebhookClient", "src\Web\WebhookClient\WebhookClient.csproj", "{766D7E92-6AF0-476C-ADD5-282BF4D8C576}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Devspace.Support", "Devspace.Support", "{68F5041D-51F2-4630-94B6-B49789F5E51A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Devspaces.Support", "src\BuildingBlocks\Devspaces.Support\Devspaces.Support.csproj", "{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -1744,6 +1748,54 @@ Global
{766D7E92-6AF0-476C-ADD5-282BF4D8C576}.Release|x64.Build.0 = Release|Any CPU
{766D7E92-6AF0-476C-ADD5-282BF4D8C576}.Release|x86.ActiveCfg = Release|Any CPU
{766D7E92-6AF0-476C-ADD5-282BF4D8C576}.Release|x86.Build.0 = Release|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|Any CPU.Build.0 = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|ARM.ActiveCfg = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|ARM.Build.0 = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|iPhone.Build.0 = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|x64.ActiveCfg = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|x64.Build.0 = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|x86.ActiveCfg = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.AppStore|x86.Build.0 = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|Any CPU.Build.0 = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|ARM.ActiveCfg = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|ARM.Build.0 = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|iPhone.Build.0 = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|x64.ActiveCfg = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|x64.Build.0 = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|x86.ActiveCfg = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Debug|x86.Build.0 = Debug|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|Any CPU.ActiveCfg = Release|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|Any CPU.Build.0 = Release|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|ARM.ActiveCfg = Release|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|ARM.Build.0 = Release|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|iPhone.ActiveCfg = Release|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|iPhone.Build.0 = Release|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|x64.ActiveCfg = Release|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|x64.Build.0 = Release|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|x86.ActiveCfg = Release|Any CPU
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -1808,6 +1860,8 @@ Global
{E0AA11C4-2873-461D-8F82-53392530FB7A} = {91CF7717-08AB-4E65-B10E-0B426F01E2E8}
{84E2016E-0435-44C6-8020-3D288AA38B2C} = {E0AA11C4-2873-461D-8F82-53392530FB7A}
{766D7E92-6AF0-476C-ADD5-282BF4D8C576} = {E279BF0F-7F66-4F3A-A3AB-2CDA66C1CD04}
{68F5041D-51F2-4630-94B6-B49789F5E51A} = {DB0EFB20-B024-4E5E-A75C-52143C131D25}
{56C2EF0B-6BF2-41D9-BE07-6E6D08D06B35} = {68F5041D-51F2-4630-94B6-B49789F5E51A}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {25728519-5F0F-4973-8A64-0A81EB4EA8D9}


+ 5
- 6
k8s/helm/apigwmm/templates/_names.tpl View File

@ -33,14 +33,13 @@
{{- end -}}
{{- define "pathBase" -}}
{{- $name := first .}}
{{- $ctx := last .}}
{{- if $ctx.Values.inf.k8s.suffix -}}
{{- $suffix := include "suffix-name" $ctx -}}
{{- printf "/%s-%s" $name $suffix -}}
{{- if .Values.inf.k8s.suffix -}}
{{- $suffix := include "suffix-name" . -}}
{{- printf "%s-%s" .Values.pathBase $suffix -}}
{{- else -}}
{{- printf "/%s" $name -}}
{{- .Values.pathBase -}}
{{- end -}}
{{- end -}}


+ 2
- 2
k8s/helm/apigwmm/templates/deployment.yaml View File

@ -61,10 +61,10 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: config
mountPath: /app/configuration
mountPath: {{ .Values.ocelot.configPath }}
env:
- name: PATH_BASE
value: {{ include "pathBase" (list .Values.app.ingress.entries.mobilemarketingapigw .) }}
value: {{ include "pathBase" . }}
- name: k8sname
value: {{ .Values.clusterName }}
{{- if .Values.env.values -}}


+ 6
- 3
k8s/helm/apigwmm/templates/ingress.yaml View File

@ -1,5 +1,6 @@
{{- if .Values.ingress.enabled -}}
{{- $ingressPath := include "pathBase" (list .Values.app.ingress.entries.mobilemarketingapigw .) -}}
{{- $ingressPath := include "pathBase" . -}}
{{- $serviceName := .Values.app.svc.mobilemarketingapigw -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
@ -23,11 +24,13 @@ spec:
{{- end }}
{{- end }}
rules:
- host: {{ .Values.inf.k8s.dns }}
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ .Values.app.svc.mobilemarketingapigw }}
serviceName: {{ $serviceName }}
servicePort: http
{{- end }}
{{- end }}

+ 2
- 0
k8s/helm/apigwmm/values.yaml View File

@ -62,3 +62,5 @@ probes:
initialDelaySeconds: 90
periodSeconds: 60
port: 80
ocelot:
configPath: /app/configuration

+ 4
- 6
k8s/helm/apigwms/templates/_names.tpl View File

@ -35,13 +35,11 @@
{{- define "pathBase" -}}
{{- $name := first .}}
{{- $ctx := last .}}
{{- if $ctx.Values.inf.k8s.suffix -}}
{{- $suffix := include "suffix-name" $ctx -}}
{{- printf "/%s-%s" $name $suffix -}}
{{- if .Values.inf.k8s.suffix -}}
{{- $suffix := include "suffix-name" . -}}
{{- printf "%s-%s" .Values.pathBase $suffix -}}
{{- else -}}
{{- printf "/%s" $name -}}
{{- .Values.pathBase -}}
{{- end -}}
{{- end -}}


+ 2
- 2
k8s/helm/apigwms/templates/deployment.yaml View File

@ -61,10 +61,10 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: config
mountPath: /app/configuration
mountPath: {{ .Values.ocelot.configPath }}
env:
- name: PATH_BASE
value: {{ include "pathBase" (list .Values.app.ingress.entries.mobileshoppingapigw .) }}
value: {{ include "pathBase" . }}
- name: k8sname
value: {{ .Values.clusterName }}
{{- if .Values.env.values -}}


+ 7
- 3
k8s/helm/apigwms/templates/ingress.yaml View File

@ -1,5 +1,7 @@
{{- if .Values.ingress.enabled -}}
{{- $ingressPath := include "pathBase" (list .Values.app.ingress.entries.mobileshoppingapigw .) -}}
{{- $ingressPath := include "pathBase" . -}}
{{- $serviceName := .Values.app.svc.mobileshoppingapigw -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
@ -23,11 +25,13 @@ spec:
{{- end }}
{{- end }}
rules:
- host: {{ .Values.inf.k8s.dns }}
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ .Values.app.svc.mobileshoppingapigw }}
serviceName: {{ $serviceName }}
servicePort: http
{{- end }}
{{- end }}

+ 3
- 1
k8s/helm/apigwms/values.yaml View File

@ -61,4 +61,6 @@ probes:
timeoutSeconds: 5
initialDelaySeconds: 90
periodSeconds: 60
port: 80
port: 80
ocelot:
configPath: /app/configuration

+ 4
- 6
k8s/helm/apigwwm/templates/_names.tpl View File

@ -35,13 +35,11 @@
{{- define "pathBase" -}}
{{- $name := first .}}
{{- $ctx := last .}}
{{- if $ctx.Values.inf.k8s.suffix -}}
{{- $suffix := include "suffix-name" $ctx -}}
{{- printf "/%s-%s" $name $suffix -}}
{{- if .Values.inf.k8s.suffix -}}
{{- $suffix := include "suffix-name" . -}}
{{- printf "%s-%s" .Values.pathBase $suffix -}}
{{- else -}}
{{- printf "/%s" $name -}}
{{- .Values.pathBase -}}
{{- end -}}
{{- end -}}


+ 2
- 2
k8s/helm/apigwwm/templates/deployment.yaml View File

@ -61,10 +61,10 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: config
mountPath: /app/configuration
mountPath: {{ .Values.ocelot.configPath }}
env:
- name: PATH_BASE
value: {{ include "pathBase" (list .Values.app.ingress.entries.webmarketingapigw .) }}
value: {{ include "pathBase" . }}
- name: k8sname
value: {{ .Values.clusterName }}
{{- if .Values.env.values -}}


+ 7
- 3
k8s/helm/apigwwm/templates/ingress.yaml View File

@ -1,5 +1,7 @@
{{- if .Values.ingress.enabled -}}
{{- $ingressPath := include "pathBase" (list .Values.app.ingress.entries.webmarketingapigw .) -}}
{{- $ingressPath := include "pathBase" . -}}
{{- $serviceName := .Values.app.svc.webmarketingapigw -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
@ -23,11 +25,13 @@ spec:
{{- end }}
{{- end }}
rules:
- host: {{ .Values.inf.k8s.dns }}
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ .Values.app.svc.webmarketingapigw }}
serviceName: {{ $serviceName }}
servicePort: http
{{- end }}
{{- end }}

+ 3
- 1
k8s/helm/apigwwm/values.yaml View File

@ -61,4 +61,6 @@ probes:
timeoutSeconds: 5
initialDelaySeconds: 90
periodSeconds: 60
port: 80
port: 80
ocelot:
configPath: /app/configuration

+ 5
- 6
k8s/helm/apigwws/templates/_names.tpl View File

@ -33,14 +33,13 @@
{{- end -}}
{{- define "pathBase" -}}
{{- $name := first .}}
{{- $ctx := last .}}
{{- if $ctx.Values.inf.k8s.suffix -}}
{{- $suffix := include "suffix-name" $ctx -}}
{{- printf "/%s-%s" $name $suffix -}}
{{- if .Values.inf.k8s.suffix -}}
{{- $suffix := include "suffix-name" . -}}
{{- printf "%s-%s" .Values.pathBase $suffix -}}
{{- else -}}
{{- printf "/%s" $name -}}
{{- .Values.pathBase -}}
{{- end -}}
{{- end -}}


+ 2
- 2
k8s/helm/apigwws/templates/deployment.yaml View File

@ -60,10 +60,10 @@ spec:
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: config
mountPath: /app/configuration
mountPath: {{ .Values.ocelot.configPath }}
env:
- name: PATH_BASE
value: {{ include "pathBase" (list .Values.app.ingress.entries.webshoppingapigw .) }}
value: {{ include "pathBase" . }}
- name: k8sname
value: {{ .Values.clusterName }}
{{- if .Values.env.values -}}


+ 6
- 3
k8s/helm/apigwws/templates/ingress.yaml View File

@ -1,5 +1,6 @@
{{- if .Values.ingress.enabled -}}
{{- $ingressPath := include "pathBase" (list .Values.app.ingress.entries.webshoppingapigw .) -}}
{{- $ingressPath := include "pathBase" . -}}
{{- $serviceName := .Values.app.svc.webshoppingapigw -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
@ -23,11 +24,13 @@ spec:
{{- end }}
{{- end }}
rules:
- host: {{ .Values.inf.k8s.dns }}
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ .Values.app.svc.webshoppingapigw }}
serviceName: {{ $serviceName }}
servicePort: http
{{- end }}
{{- end }}

+ 2
- 0
k8s/helm/apigwws/values.yaml View File

@ -62,3 +62,5 @@ probes:
initialDelaySeconds: 90
periodSeconds: 60
port: 80
ocelot:
configPath: /app/configuration

+ 37
- 0
k8s/helm/basket-api/templates/ingress.yaml View File

@ -0,0 +1,37 @@
{{- if .Values.ingress.enabled -}}
{{- $ingressPath := include "pathBase" . -}}
{{- $serviceName := .Values.app.svc.basket -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "basket-api.fullname" . }}
labels:
app: {{ template "basket-api.name" . }}
chart: {{ template "basket-api.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
- {{ .Values.inf.k8s.dns }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ $serviceName }}
servicePort: http
{{- end }}
{{- end }}

+ 3
- 0
k8s/helm/basket-api/values.yaml View File

@ -53,3 +53,6 @@ probes:
initialDelaySeconds: 90
periodSeconds: 60
port: 80
ingress:
enabled: false

+ 37
- 0
k8s/helm/catalog-api/templates/ingress.yaml View File

@ -0,0 +1,37 @@
{{- if .Values.ingress.enabled -}}
{{- $ingressPath := include "pathBase" . -}}
{{- $serviceName := .Values.app.svc.catalog -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "catalog-api.fullname" . }}
labels:
app: {{ template "catalog-api.name" . }}
chart: {{ template "catalog-api.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
- {{ .Values.inf.k8s.dns }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ $serviceName }}
servicePort: http
{{- end }}
{{- end }}

+ 18
- 9
k8s/helm/deploy-all.ps1 View File

@ -5,6 +5,7 @@ Param(
[parameter(Mandatory=$false)][string]$externalDns,
[parameter(Mandatory=$false)][string]$appName="eshop",
[parameter(Mandatory=$false)][bool]$deployInfrastructure=$true,
[parameter(Mandatory=$false)][bool]$deployCharts=$true,
[parameter(Mandatory=$false)][bool]$clean=$true,
[parameter(Mandatory=$false)][string]$aksName="",
[parameter(Mandatory=$false)][string]$aksRg="",
@ -66,20 +67,28 @@ $charts = ("eshop-common", "apigwmm", "apigwms", "apigwwm", "apigwws", "basket-a
if ($deployInfrastructure) {
foreach ($infra in $infras) {
Write-Host "Installing infrastructure: $infra" -ForegroundColor Green
helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --name="$appName-$infra" $infra
helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set ingress.hosts={$dns} --name="$appName-$infra" $infra
}
}
else {
Write-Host "eShopOnContainers infrastructure (bbdd, redis, ...) charts aren't installed (-deployCharts is false)" -ForegroundColor Yellow
}
foreach ($chart in $charts) {
Write-Host "Installing: $chart" -ForegroundColor Green
if ($useCustomRegistry) {
helm install --set inf.registry.server=$registry --set inf.registry.login=$dockerUser --set inf.registry.pwd=$dockerPassword --set inf.registry.secretName=eshop-docker-scret --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set image.tag=$imageTag --set image.pullPolicy=Always --name="$appName-$chart" $chart
}
else {
if ($chart -ne "eshop-common") { # eshop-common is ignored when no secret must be deployed
helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set image.tag=$imageTag --set image.pullPolicy=Always --name="$appName-$chart" $chart
if ($deployCharts) {
foreach ($chart in $charts) {
Write-Host "Installing: $chart" -ForegroundColor Green
if ($useCustomRegistry) {
helm install --set inf.registry.server=$registry --set inf.registry.login=$dockerUser --set inf.registry.pwd=$dockerPassword --set inf.registry.secretName=eshop-docker-scret --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set ingress.hosts={$dns} --set image.tag=$imageTag --set image.pullPolicy=Always --name="$appName-$chart" $chart
}
else {
if ($chart -ne "eshop-common") { # eshop-common is ignored when no secret must be deployed
helm install --values app.yaml --values inf.yaml --values $ingressValuesFile --set app.name=$appName --set inf.k8s.dns=$dns --set ingress.hosts={$dns} --set image.tag=$imageTag --set image.pullPolicy=Always --name="$appName-$chart" $chart
}
}
}
}
else {
Write-Host "eShopOnContainers non-infrastructure charts aren't installed (-deployCharts is false)" -ForegroundColor Yellow
}
Write-Host "helm charts installed." -ForegroundColor Green

+ 1
- 2
k8s/helm/identity-api/templates/configmap.yaml View File

@ -36,5 +36,4 @@ data:
xamarin_callback_e: http://{{ $xamarincallback }}
webhooksapi_e: http://{{ $webhooks_url }}
webhooksweb_e: http://{{ $webhooksweb_url }}
enableDevspaces: "{{ .Values.enableDevspaces }}"

+ 5
- 2
k8s/helm/identity-api/templates/ingress.yaml View File

@ -1,5 +1,6 @@
{{- if .Values.ingress.enabled -}}
{{- $ingressPath := include "pathBase" . -}}
{{- $serviceName := .Values.app.svc.identity }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
@ -23,11 +24,13 @@ spec:
{{- end }}
{{- end }}
rules:
- host: {{ .Values.inf.k8s.dns }}
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ .Values.app.svc.identity }}
serviceName: {{ $serviceName }}
servicePort: http
{{- end }}
{{- end }}

+ 6
- 1
k8s/helm/identity-api/values.yaml View File

@ -58,6 +58,8 @@ env:
key: webhooksapi_e
- name: WebhooksWebClient
key: webhooksweb_e
- name: EnableDevspaces
key: enableDevspaces
values:
- name: ASPNETCORE_ENVIRONMENT
value: Development
@ -65,6 +67,7 @@ env:
value: 'K8S'
- name: IsClusterEnv
value: 'True'
probes:
liveness:
path: /liveness
@ -76,4 +79,6 @@ probes:
timeoutSeconds: 5
initialDelaySeconds: 90
periodSeconds: 60
port: 80
port: 80
enableDevspaces: "false"

+ 36
- 0
k8s/helm/locations-api/templates/ingress.yaml View File

@ -0,0 +1,36 @@
{{- if .Values.ingress.enabled -}}
{{- $ingressPath := include "pathBase" . -}}
{{- $serviceName := .Values.app.svc.locations }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "locations-api.fullname" . }}
labels:
app: {{ template "locations-api.name" . }}
chart: {{ template "locations-api.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
- {{ .Values.inf.k8s.dns }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ $serviceName }}
servicePort: http
{{- end }}
{{- end }}

+ 36
- 0
k8s/helm/marketing-api/templates/ingress.yaml View File

@ -0,0 +1,36 @@
{{- if .Values.ingress.enabled -}}
{{- $ingressPath := include "pathBase" . -}}
{{- $serviceName := .Values.app.svc.marketing }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "marketing-api.fullname" . }}
labels:
app: {{ template "marketing-api.name" . }}
chart: {{ template "marketing-api.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
- {{ .Values.inf.k8s.dns }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ $serviceName }}
servicePort: http
{{- end }}
{{- end }}

+ 36
- 0
k8s/helm/mobileshoppingagg/templates/ingress.yaml View File

@ -0,0 +1,36 @@
{{- if .Values.ingress.enabled -}}
{{- $ingressPath := include "pathBase" . -}}
{{- $serviceName := .Values.app.svc.mobileshoppingagg }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "mobileshoppingagg.fullname" . }}
labels:
app: {{ template "mobileshoppingagg.name" . }}
chart: {{ template "mobileshoppingagg.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
- {{ .Values.inf.k8s.dns }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ $serviceName }}
servicePort: http
{{- end }}
{{- end }}

+ 2
- 1
k8s/helm/ordering-backgroundtasks/templates/configmap.yaml View File

@ -1,10 +1,11 @@
{{- $name := include "ordering-backgroundtasks.fullname" . -}}
{{- $sqlsrv := include "sql-name" . -}}
{{- $cfgname := printf "cfg-%s" $name | trunc 63 }}
apiVersion: v1
kind: ConfigMap
metadata:
name: "cfg-{{ $name }}"
name: "{{ $cfgname }}"
labels:
app: {{ template "ordering-backgroundtasks.name" . }}
chart: {{ template "ordering-backgroundtasks.chart" .}}


+ 2
- 2
k8s/helm/ordering-backgroundtasks/templates/deployment.yaml View File

@ -1,11 +1,11 @@
{{- $name := include "ordering-backgroundtasks.fullname" . -}}
{{- $cfgname := printf "%s-%s" "cfg" $name -}}
{{- $cfgname := printf "cfg-%s" $name | trunc 63 }}
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: {{ template "ordering-backgroundtasks.fullname" . }}
labels:
ufo: {{ $cfgname}}
app: {{ template "ordering-backgroundtasks.name" . }}
chart: {{ template "ordering-backgroundtasks.chart" . }}
release: {{ .Release.Name }}


+ 5
- 2
k8s/helm/webhooks-api/templates/ingress.yaml View File

@ -1,5 +1,6 @@
{{- if .Values.ingress.enabled -}}
{{- $ingressPath := include "pathBase" . -}}
{{- $serviceName := .Values.app.svc.webhooks }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
@ -23,11 +24,13 @@ spec:
{{- end }}
{{- end }}
rules:
- host: {{ .Values.inf.k8s.dns }}
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ .Values.app.svc.webhooks }}
serviceName: {{ $serviceName }}
servicePort: http
{{- end }}
{{- end }}

+ 0
- 1
k8s/helm/webmvc/templates/configmap.yaml View File

@ -2,7 +2,6 @@
{{- $identity := include "url-of" (list .Values.app.ingress.entries.identity .) -}}
{{- $webshoppingapigw := include "url-of" (list .Values.app.ingress.entries.webshoppingapigw .) -}}
{{- $mvc := include "url-of" (list .Values.app.ingress.entries.mvc .) -}}
{{- $mongo := include "mongo-name" . -}}
apiVersion: v1


+ 5
- 2
k8s/helm/webmvc/templates/ingress.yaml View File

@ -1,5 +1,6 @@
{{- if .Values.ingress.enabled -}}
{{- $ingressPath := include "pathBase" . -}}
{{- $serviceName := .Values.app.svc.mvc -}}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
@ -23,11 +24,13 @@ spec:
{{- end }}
{{- end }}
rules:
- host: {{ .Values.inf.k8s.dns }}
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ .Values.app.svc.mvc }}
serviceName: {{ $serviceName }}
servicePort: http
{{- end }}
{{- end }}

+ 36
- 0
k8s/helm/webshoppingagg/templates/ingress.yaml View File

@ -0,0 +1,36 @@
{{- if .Values.ingress.enabled -}}
{{- $ingressPath := include "pathBase" . -}}
{{- $serviceName := .Values.app.svc.webshoppingagg }}
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: {{ template "webshoppingagg.fullname" . }}
labels:
app: {{ template "webshoppingagg.name" . }}
chart: {{ template "webshoppingagg.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
- {{ .Values.inf.k8s.dns }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ . }}
http:
paths:
- path: {{ $ingressPath }}
backend:
serviceName: {{ $serviceName }}
servicePort: http
{{- end }}
{{- end }}

+ 14
- 0
src/ApiGateways/ApiGw-Base/Dockerfile.develop View File

@ -0,0 +1,14 @@
FROM microsoft/dotnet:2.2-sdk
ARG BUILD_CONFIGURATION=Debug
ENV ASPNETCORE_ENVIRONMENT=Development
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
EXPOSE 80
WORKDIR /src
COPY ["src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj", "src/ApiGateways/ApiGw-Base/"]
RUN dotnet restore "src/ApiGateways/ApiGw-Base/OcelotApiGw.csproj"
COPY . .
WORKDIR "/src/src/ApiGateways/ApiGw-Base"
RUN dotnet build --no-restore "OcelotApiGw.csproj" -c $BUILD_CONFIGURATION
ENTRYPOINT ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"]

+ 44
- 0
src/ApiGateways/Mobile.Bff.Marketing/apigw/azds.yaml View File

@ -0,0 +1,44 @@
kind: helm-release
apiVersion: 1.1
build:
context: ..\..\..\..\
dockerfile: ..\..\..\ApiGateways\ApiGw-Base\Dockerfile
install:
chart: ../../../../k8s/helm/apigwmm
set:
replicaCount: 1
image:
tag: $(tag)
pullPolicy: Never
ingress:
annotations:
kubernetes.io/ingress.class: traefik-azds
hosts:
# This expands to [space.s.]webmvc.<guid>.<region>.aksapp.io
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values:
- values.dev.yaml?
- secrets.dev.yaml?
- inf.yaml
- app.yaml
configurations:
develop:
build:
useGitIgnore: true
dockerfile: ..\..\..\ApiGateways\ApiGw-Base\Dockerfile.develop
args:
BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug}
container:
sync:
- '**/Pages/**'
- '**/Views/**'
- '**/wwwroot/**'
- '!**/*.{sln,csproj}'
command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"]
iterate:
processesToKill: [dotnet, vsdbg]
buildCommands:
- [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"]

+ 2
- 0
src/ApiGateways/Mobile.Bff.Marketing/apigw/values.dev.yaml View File

@ -0,0 +1,2 @@
ocelot:
configPath: /src/src/ApiGateways/ApiGw-Base/configuration

+ 16
- 0
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Dockerfile.develop View File

@ -0,0 +1,16 @@
FROM microsoft/dotnet:2.2-sdk
ARG BUILD_CONFIGURATION=Debug
ENV ASPNETCORE_ENVIRONMENT=Development
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
EXPOSE 80
WORKDIR /src
COPY ["src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj", "src/ApiGateways/Mobile.Bff.Shopping/aggregator/"]
COPY ["src/BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj", "src/BuildingBlocks/Devspaces.Support/"]
RUN dotnet restore src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj -nowarn:msb3202,nu1503
COPY . .
WORKDIR "/src/src/ApiGateways/Mobile.Bff.Shopping/aggregator"
RUN dotnet build --no-restore -c $BUILD_CONFIGURATION
CMD ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"]]

+ 4
- 0
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Mobile.Shopping.HttpAggregator.csproj View File

@ -23,4 +23,8 @@
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="2.2.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\BuildingBlocks\Devspaces.Support\Devspaces.Support.csproj" />
</ItemGroup>
</Project>

+ 7
- 0
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Properties/launchSettings.json View File

@ -24,6 +24,13 @@
"ASPNETCORE_ENVIRONMENT": "Development"
},
"applicationUrl": "http://localhost:61632/"
},
"Azure Dev Spaces": {
"commandName": "AzureDevSpaces",
"launchBrowser": true,
"resourceGroup": "eshoptestedu",
"aksName": "eshoptestedu",
"subscriptionId": "e3035ac1-c06c-4daf-8939-57b3c5f1f759"
}
}
}

+ 8
- 3
src/ApiGateways/Mobile.Bff.Shopping/aggregator/Startup.cs View File

@ -20,6 +20,7 @@ using Swashbuckle.AspNetCore.Swagger;
using HealthChecks.UI.Client;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Devspaces.Support;
namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator
{
@ -47,6 +48,7 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator
services.AddCustomMvc(Configuration)
.AddCustomAuthentication(Configuration)
.AddDevspaces()
.AddHttpServices();
}
@ -188,15 +190,18 @@ namespace Microsoft.eShopOnContainers.Mobile.Shopping.HttpAggregator
services.AddHttpClient<IBasketService, BasketService>()
.AddHttpMessageHandler<HttpClientAuthorizationDelegatingHandler>()
.AddPolicyHandler(GetRetryPolicy())
.AddPolicyHandler(GetCircuitBreakerPolicy());
.AddPolicyHandler(GetCircuitBreakerPolicy())
.AddDevspacesSupport();
services.AddHttpClient<ICatalogService, CatalogService>()
.AddPolicyHandler(GetRetryPolicy())
.AddPolicyHandler(GetCircuitBreakerPolicy());
.AddPolicyHandler(GetCircuitBreakerPolicy())
.AddDevspacesSupport();
services.AddHttpClient<IOrderApiClient, OrderApiClient>()
.AddPolicyHandler(GetRetryPolicy())
.AddPolicyHandler(GetCircuitBreakerPolicy());
.AddPolicyHandler(GetCircuitBreakerPolicy())
.AddDevspacesSupport();
return services;
}


+ 55
- 0
src/ApiGateways/Mobile.Bff.Shopping/aggregator/azds.yaml View File

@ -0,0 +1,55 @@
kind: helm-release
apiVersion: 1.1
build:
context: ..\..\..\..
dockerfile: Dockerfile
install:
chart: ../../../../k8s/helm/mobileshoppingagg
set:
image:
tag: $(tag)
pullPolicy: Never
ingress:
annotations:
kubernetes.io/ingress.class: traefik-azds
hosts:
# This expands to [space.s.]apigwms.<guid>.<region>.aksapp.io
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values:
- values.dev.yaml?
- secrets.dev.yaml?
- app.yaml
- inf.yaml
configurations:
develop:
build:
useGitIgnore: true
dockerfile: Dockerfile.develop
container:
syncTarget: /src
sync:
- '**/Pages/**'
- '**/Views/**'
- '**/wwwroot/**'
- '!**/*.{sln,csproj}'
command:
- dotnet
- run
- --no-restore
- --no-build
- --no-launch-profile
- -c
- ${Configuration:-Debug}
iterate:
processesToKill:
- dotnet
- vsdbg
buildCommands:
- - dotnet
- build
- --no-restore
- -c
- ${Configuration:-Debug}

+ 3
- 0
src/ApiGateways/Mobile.Bff.Shopping/aggregator/values.dev.yaml View File

@ -0,0 +1,3 @@
ingress:
enabled: true
tls: []

+ 44
- 0
src/ApiGateways/Mobile.Bff.Shopping/apigw/azds.yaml View File

@ -0,0 +1,44 @@
kind: helm-release
apiVersion: 1.1
build:
context: ..\..\..\..\
dockerfile: ..\..\..\ApiGateways\ApiGw-Base\Dockerfile
install:
chart: ../../../../k8s/helm/apigwms
set:
replicaCount: 1
image:
tag: $(tag)
pullPolicy: Never
ingress:
annotations:
kubernetes.io/ingress.class: traefik-azds
hosts:
# This expands to [space.s.]webmvc.<guid>.<region>.aksapp.io
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values:
- values.dev.yaml?
- secrets.dev.yaml?
- inf.yaml
- app.yaml
configurations:
develop:
build:
useGitIgnore: true
dockerfile: ..\..\..\ApiGateways\ApiGw-Base\Dockerfile.develop
args:
BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug}
container:
sync:
- '**/Pages/**'
- '**/Views/**'
- '**/wwwroot/**'
- '!**/*.{sln,csproj}'
command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"]
iterate:
processesToKill: [dotnet, vsdbg]
buildCommands:
- [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"]

+ 2
- 0
src/ApiGateways/Mobile.Bff.Shopping/apigw/values.dev.yaml View File

@ -0,0 +1,2 @@
ocelot:
configPath: /src/src/ApiGateways/ApiGw-Base/configuration

+ 44
- 0
src/ApiGateways/Web.Bff.Marketing/apigw/azds.yaml View File

@ -0,0 +1,44 @@
kind: helm-release
apiVersion: 1.1
build:
context: ..\..\..\..\
dockerfile: ..\..\..\ApiGateways\ApiGw-Base\Dockerfile
install:
chart: ../../../../k8s/helm/apigwwm
set:
replicaCount: 1
image:
tag: $(tag)
pullPolicy: Never
ingress:
annotations:
kubernetes.io/ingress.class: traefik-azds
hosts:
# This expands to [space.s.]webmvc.<guid>.<region>.aksapp.io
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values:
- values.dev.yaml?
- secrets.dev.yaml?
- inf.yaml
- app.yaml
configurations:
develop:
build:
useGitIgnore: true
dockerfile: ..\..\..\ApiGateways\ApiGw-Base\Dockerfile.develop
args:
BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug}
container:
sync:
- '**/Pages/**'
- '**/Views/**'
- '**/wwwroot/**'
- '!**/*.{sln,csproj}'
command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"]
iterate:
processesToKill: [dotnet, vsdbg]
buildCommands:
- [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"]

+ 2
- 0
src/ApiGateways/Web.Bff.Marketing/apigw/values.dev.yaml View File

@ -0,0 +1,2 @@
ocelot:
configPath: /src/src/ApiGateways/ApiGw-Base/configuration

+ 16
- 0
src/ApiGateways/Web.Bff.Shopping/aggregator/Dockerfile.develop View File

@ -0,0 +1,16 @@
FROM microsoft/dotnet:2.2-sdk
ARG BUILD_CONFIGURATION=Debug
ENV ASPNETCORE_ENVIRONMENT=Development
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
EXPOSE 80
WORKDIR /src
COPY ["src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj", "src/ApiGateways/Web.Bff.Shopping/aggregator/"]
COPY ["src/BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj", "src/BuildingBlocks/Devspaces.Support/"]
RUN dotnet restore src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj -nowarn:msb3202,nu1503
COPY . .
WORKDIR "/src/src/ApiGateways/Web.Bff.Shopping/aggregator"
RUN dotnet build --no-restore -c $BUILD_CONFIGURATION
CMD ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"]]

+ 9
- 5
src/ApiGateways/Web.Bff.Shopping/aggregator/Startup.cs View File

@ -21,6 +21,7 @@ using System.Net.Http;
using HealthChecks.UI.Client;
using Microsoft.AspNetCore.Diagnostics.HealthChecks;
using Microsoft.Extensions.Diagnostics.HealthChecks;
using Devspaces.Support;
namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator
{
@ -48,6 +49,7 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator
services.AddCustomMvc(Configuration)
.AddCustomAuthentication(Configuration)
.AddDevspaces()
.AddApplicationServices();
}
@ -182,21 +184,23 @@ namespace Microsoft.eShopOnContainers.Web.Shopping.HttpAggregator
services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
//register http services
services.AddHttpClient<IBasketService, BasketService>()
.AddHttpMessageHandler<HttpClientAuthorizationDelegatingHandler>()
.AddPolicyHandler(GetRetryPolicy())
.AddPolicyHandler(GetCircuitBreakerPolicy());
.AddPolicyHandler(GetCircuitBreakerPolicy())
.AddDevspacesSupport();
services.AddHttpClient<ICatalogService, CatalogService>()
.AddPolicyHandler(GetRetryPolicy())
.AddPolicyHandler(GetCircuitBreakerPolicy());
.AddPolicyHandler(GetCircuitBreakerPolicy())
.AddDevspacesSupport();
services.AddHttpClient<IOrderApiClient, OrderApiClient>()
.AddHttpMessageHandler<HttpClientAuthorizationDelegatingHandler>()
.AddPolicyHandler(GetRetryPolicy())
.AddPolicyHandler(GetCircuitBreakerPolicy());
.AddPolicyHandler(GetCircuitBreakerPolicy())
.AddDevspacesSupport();
return services;
}


+ 4
- 0
src/ApiGateways/Web.Bff.Shopping/aggregator/Web.Shopping.HttpAggregator.csproj View File

@ -22,4 +22,8 @@
<PackageReference Include="Microsoft.Extensions.Http.Polly" Version="2.2.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\..\BuildingBlocks\Devspaces.Support\Devspaces.Support.csproj" />
</ItemGroup>
</Project>

+ 55
- 0
src/ApiGateways/Web.Bff.Shopping/aggregator/azds.yaml View File

@ -0,0 +1,55 @@
kind: helm-release
apiVersion: 1.1
build:
context: ..\..\..\..
dockerfile: Dockerfile
install:
chart: ../../../../k8s/helm/webshoppingagg
set:
image:
tag: $(tag)
pullPolicy: Never
ingress:
annotations:
kubernetes.io/ingress.class: traefik-azds
hosts:
# This expands to [space.s.]apigwms.<guid>.<region>.aksapp.io
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values:
- values.dev.yaml?
- secrets.dev.yaml?
- app.yaml
- inf.yaml
configurations:
develop:
build:
useGitIgnore: true
dockerfile: Dockerfile.develop
container:
syncTarget: /src
sync:
- '**/Pages/**'
- '**/Views/**'
- '**/wwwroot/**'
- '!**/*.{sln,csproj}'
command:
- dotnet
- run
- --no-restore
- --no-build
- --no-launch-profile
- -c
- ${Configuration:-Debug}
iterate:
processesToKill:
- dotnet
- vsdbg
buildCommands:
- - dotnet
- build
- --no-restore
- -c
- ${Configuration:-Debug}

+ 2
- 0
src/ApiGateways/Web.Bff.Shopping/aggregator/values.dev.yaml View File

@ -0,0 +1,2 @@
ocelot:
configPath: /app/configuration

+ 43
- 0
src/ApiGateways/Web.Bff.Shopping/apigw/azds.yaml View File

@ -0,0 +1,43 @@
kind: helm-release
apiVersion: 1.1
build:
context: ..\..\..\..\
dockerfile: ..\..\..\..\ApiGateways\ApiGw-Base\Dockerfile
install:
chart: ../../../../k8s/helm/apigwws
set:
replicaCount: 1
image:
tag: $(tag)
pullPolicy: Never
ingress:
annotations:
kubernetes.io/ingress.class: traefik-azds
hosts:
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values:
- values.dev.yaml?
- secrets.dev.yaml?
- inf.yaml
- app.yaml
configurations:
develop:
build:
useGitIgnore: true
dockerfile: ..\..\..\ApiGateways\ApiGw-Base\Dockerfile.develop
args:
BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug}
container:
sync:
- '**/Pages/**'
- '**/Views/**'
- '**/wwwroot/**'
- '!**/*.{sln,csproj}'
command: [dotnet, run, --no-restore, --no-build, --no-launch-profile, -c, "${BUILD_CONFIGURATION:-Debug}"]
iterate:
processesToKill: [dotnet, vsdbg]
buildCommands:
- [dotnet, build, --no-restore, -c, "${BUILD_CONFIGURATION:-Debug}"]

+ 2
- 0
src/ApiGateways/Web.Bff.Shopping/apigw/values.dev.yaml View File

@ -0,0 +1,2 @@
ocelot:
configPath: /src/src/ApiGateways/ApiGw-Base/configuration

+ 11
- 0
src/BuildingBlocks/Devspaces.Support/Devspaces.Support.csproj View File

@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.2.0" />
<PackageReference Include="Microsoft.Extensions.Http" Version="2.2.0" />
</ItemGroup>
</Project>

+ 30
- 0
src/BuildingBlocks/Devspaces.Support/DevspacesMessageHandler.cs View File

@ -0,0 +1,30 @@
using Microsoft.AspNetCore.Http;
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading;
using System.Threading.Tasks;
namespace Devspaces.Support
{
public class DevspacesMessageHandler : DelegatingHandler
{
private const string DevspacesHeaderName = "azds-route-as";
private readonly IHttpContextAccessor _httpContextAccessor;
public DevspacesMessageHandler(IHttpContextAccessor httpContextAccessor)
{
_httpContextAccessor = httpContextAccessor;
}
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
{
var req = _httpContextAccessor.HttpContext.Request;
if (req.Headers.ContainsKey(DevspacesHeaderName))
{
request.Headers.Add(DevspacesHeaderName, req.Headers[DevspacesHeaderName] as IEnumerable<string>);
}
return base.SendAsync(request, cancellationToken);
}
}
}

+ 16
- 0
src/BuildingBlocks/Devspaces.Support/HttpClientBuilderDevspacesExtensions.cs View File

@ -0,0 +1,16 @@
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Text;
namespace Devspaces.Support
{
public static class HttpClientBuilderDevspacesExtensions
{
public static IHttpClientBuilder AddDevspacesSupport(this IHttpClientBuilder builder)
{
builder.AddHttpMessageHandler<DevspacesMessageHandler>();
return builder;
}
}
}

+ 16
- 0
src/BuildingBlocks/Devspaces.Support/ServiceCollectionDevspacesExtensions.cs View File

@ -0,0 +1,16 @@
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Text;
namespace Devspaces.Support
{
public static class ServiceCollectionDevspacesExtensions
{
public static IServiceCollection AddDevspaces(this IServiceCollection services)
{
services.AddTransient<DevspacesMessageHandler>();
return services;
}
}
}

+ 33
- 14
src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.cs View File

@ -178,27 +178,46 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ
{
if (_consumerChannel != null)
{
var consumer = new EventingBasicConsumer(_consumerChannel);
consumer.Received += async (model, ea) =>
{
var eventName = ea.RoutingKey;
var message = Encoding.UTF8.GetString(ea.Body);
await ProcessEvent(eventName, message);
var consumer = new AsyncEventingBasicConsumer(_consumerChannel);
_consumerChannel.BasicAck(ea.DeliveryTag, multiple: false);
};
consumer.Received += Consumer_Received;
_consumerChannel.BasicConsume(queue: _queueName,
autoAck: false,
consumer: consumer);
_consumerChannel.BasicConsume(
queue: _queueName,
autoAck: false,
consumer: consumer);
}
else
{
_logger.LogError("StartBasicConsume can not call on _consumerChannelCreated == false");
_logger.LogError("StartBasicConsume can't call on _consumerChannel == null");
}
}
private async Task Consumer_Received(object sender, BasicDeliverEventArgs eventArgs)
{
var eventName = eventArgs.RoutingKey;
var message = Encoding.UTF8.GetString(eventArgs.Body);
try
{
if (message.ToLowerInvariant().Contains("throw-fake-exception"))
{
throw new InvalidOperationException($"Fake exception requested: \"{message}\"");
}
await ProcessEvent(eventName, message);
}
catch (Exception ex)
{
_logger.LogWarning(ex, "----- ERROR Processing message \"{Message}\"", message);
}
// Even on exception we take the message off the queue.
// in a REAL WORLD app this should be handled with a Dead Letter Exchange (DLX).
// For more information see: https://www.rabbitmq.com/dlx.html
_consumerChannel.BasicAck(eventArgs.DeliveryTag, multiple: false);
}
private IModel CreateConsumerChannel()
{
if (!_persistentConnection.IsConnected)
@ -209,7 +228,7 @@ namespace Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ
var channel = _persistentConnection.CreateModel();
channel.ExchangeDeclare(exchange: BROKER_NAME,
type: "direct");
type: "direct");
channel.QueueDeclare(queue: _queueName,
durable: true,


+ 14
- 0
src/Services/Basket/Basket.API/.dockerignore View File

@ -0,0 +1,14 @@
.dockerignore
.git
.gitignore
.vs
.vscode
**/*.*proj.user
**/azds.yaml
**/bin
**/charts
**/Dockerfile
**/Dockerfile.develop
**/obj
**/secrets.dev.yaml
**/values.dev.yaml

+ 2
- 2
src/Services/Basket/Basket.API/Controllers/BasketController.cs View File

@ -41,14 +41,14 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API.Controllers
{
var basket = await _repository.GetBasketAsync(id);
return basket ?? new CustomerBasket(id);
return Ok(basket ?? new CustomerBasket(id));
}
[HttpPost]
[ProducesResponseType(typeof(CustomerBasket), (int)HttpStatusCode.OK)]
public async Task<ActionResult<CustomerBasket>> UpdateBasketAsync([FromBody]CustomerBasket value)
{
return await _repository.UpdateBasketAsync(value);
return Ok(await _repository.UpdateBasketAsync(value));
}
[Route("checkout")]


+ 19
- 0
src/Services/Basket/Basket.API/Dockerfile.develop View File

@ -0,0 +1,19 @@
FROM microsoft/dotnet:2.2-sdk
ARG BUILD_CONFIGURATION=Debug
ENV ASPNETCORE_ENVIRONMENT=Development
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
EXPOSE 80
WORKDIR /src
COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"]
COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"]
COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"]
COPY ["src/Services/Basket/Basket.API/Basket.API.csproj", "src/Services/Basket/Basket.API/"]
RUN dotnet restore src/Services/Basket/Basket.API/Basket.API.csproj -nowarn:msb3202,nu1503
COPY . .
WORKDIR /src/src/Services/Basket/Basket.API
RUN dotnet build --no-restore -c $BUILD_CONFIGURATION
ENTRYPOINT ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"]

+ 2
- 1
src/Services/Basket/Basket.API/Startup.cs View File

@ -105,7 +105,8 @@ namespace Microsoft.eShopOnContainers.Services.Basket.API
var factory = new ConnectionFactory()
{
HostName = Configuration["EventBusConnection"]
HostName = Configuration["EventBusConnection"],
DispatchConsumersAsync = true
};
if (!string.IsNullOrEmpty(Configuration["EventBusUserName"]))


+ 56
- 0
src/Services/Basket/Basket.API/azds.yaml View File

@ -0,0 +1,56 @@
kind: helm-release
apiVersion: 1.1
build:
context: ..\..\..\..
dockerfile: Dockerfile
install:
chart: ../../../../k8s/helm/basket-api
set:
replicaCount: 1
image:
tag: $(tag)
pullPolicy: Never
ingress:
annotations:
kubernetes.io/ingress.class: traefik-azds
hosts:
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values:
- values.dev.yaml?
- secrets.dev.yaml?
- inf.yaml
- app.yaml
configurations:
develop:
build:
useGitIgnore: true
dockerfile: Dockerfile.develop
args:
BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug}
container:
sync:
- '**/Pages/**'
- '**/Views/**'
- '**/wwwroot/**'
- '!**/*.{sln,csproj}'
command:
- dotnet
- run
- --no-restore
- --no-build
- --no-launch-profile
- -c
- ${BUILD_CONFIGURATION:-Debug}
iterate:
processesToKill:
- dotnet
- vsdbg
buildCommands:
- - dotnet
- build
- --no-restore
- -c
- ${BUILD_CONFIGURATION:-Debug}

+ 3
- 0
src/Services/Basket/Basket.API/values.dev.yaml View File

@ -0,0 +1,3 @@
ingress:
enabled: true
tls: []

+ 2
- 0
src/Services/Basket/Basket.FunctionalTests/Basket.FunctionalTests.csproj View File

@ -17,6 +17,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="2.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.2.0" />
<PackageReference Include="xunit" Version="2.4.1" />


+ 2
- 2
src/Services/Basket/Basket.UnitTests/Application/BasketWebApiTest.cs View File

@ -55,7 +55,7 @@ namespace UnitTest.Basket.Application
//Assert
Assert.Equal((actionResult.Result as OkObjectResult).StatusCode, (int)System.Net.HttpStatusCode.OK);
Assert.Equal(((CustomerBasket)actionResult.Value).BuyerId, fakeCustomerId);
Assert.Equal((((ObjectResult)actionResult.Result).Value as CustomerBasket).BuyerId, fakeCustomerId);
}
[Fact]
@ -81,7 +81,7 @@ namespace UnitTest.Basket.Application
//Assert
Assert.Equal((actionResult.Result as OkObjectResult).StatusCode, (int)System.Net.HttpStatusCode.OK);
Assert.Equal(((CustomerBasket)actionResult.Value).BuyerId, fakeCustomerId);
Assert.Equal((((ObjectResult)actionResult.Result).Value as CustomerBasket).BuyerId, fakeCustomerId);
}
[Fact]


+ 2
- 0
src/Services/Basket/Basket.UnitTests/Basket.UnitTests.csproj View File

@ -7,6 +7,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="2.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">


+ 9
- 0
src/Services/Catalog/Catalog.API/Controllers/CatalogController.cs View File

@ -60,6 +60,15 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Controllers
.Take(pageSize)
.ToListAsync();
/* The "awesome" fix for testing Devspaces */
/*
foreach (var pr in itemsOnPage) {
pr.Name = "Awesome " + pr.Name;
}
*/
itemsOnPage = ChangeUriPlaceholder(itemsOnPage);
var model = new PaginatedItemsViewModel<CatalogItem>(pageIndex, pageSize, totalItems, itemsOnPage);


+ 21
- 0
src/Services/Catalog/Catalog.API/Dockerfile.develop View File

@ -0,0 +1,21 @@
FROM microsoft/dotnet:2.2-sdk
ARG BUILD_CONFIGURATION=Debug
ENV ASPNETCORE_ENVIRONMENT=Development
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
EXPOSE 80
WORKDIR /src
COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"]
COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"]
COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"]
COPY ["src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj", "src/BuildingBlocks/EventBus/IntegrationEventLogEF/"]
COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"]
COPY ["src/Services/Catalog/Catalog.API/Catalog.API.csproj", "src/Services/Catalog/Catalog.API/"]
RUN dotnet restore src/Services/Catalog/Catalog.API/Catalog.API.csproj -nowarn:msb3202,nu1503
COPY . .
WORKDIR "/src/src/Services/Catalog/Catalog.API"
RUN dotnet build --no-restore -c $BUILD_CONFIGURATION
ENTRYPOINT ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"]

+ 1
- 1
src/Services/Catalog/Catalog.API/Model/CatalogItem.cs View File

@ -64,7 +64,7 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API.Model
if (quantityDesired <= 0)
{
throw new CatalogDomainException($"Item units desired should be greater than cero");
throw new CatalogDomainException($"Item units desired should be greater than zero");
}
int removed = Math.Min(quantityDesired, this.AvailableStock);


+ 7
- 0
src/Services/Catalog/Catalog.API/Properties/launchSettings.json View File

@ -27,6 +27,13 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Azure Dev Spaces": {
"commandName": "AzureDevSpaces",
"launchBrowser": true,
"resourceGroup": "edu-devspaces3",
"aksName": "edu-devspaces3",
"subscriptionId": "e3035ac1-c06c-4daf-8939-57b3c5f1f759"
}
}
}

+ 2
- 1
src/Services/Catalog/Catalog.API/Startup.cs View File

@ -297,7 +297,8 @@ namespace Microsoft.eShopOnContainers.Services.Catalog.API
var factory = new ConnectionFactory()
{
HostName = configuration["EventBusConnection"]
HostName = configuration["EventBusConnection"],
DispatchConsumersAsync = true
};
if (!string.IsNullOrEmpty(configuration["EventBusUserName"]))


+ 54
- 0
src/Services/Catalog/Catalog.API/azds.yaml View File

@ -0,0 +1,54 @@
kind: helm-release
apiVersion: 1.1
build:
context: ..\..\..\..
dockerfile: Dockerfile
install:
chart: ../../../../k8s/helm/catalog-api
set:
image:
tag: $(tag)
pullPolicy: Never
ingress:
annotations:
kubernetes.io/ingress.class: traefik-azds
hosts:
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values:
- values.dev.yaml?
- secrets.dev.yaml?
- inf.yaml
- app.yaml
configurations:
develop:
build:
useGitIgnore: true
dockerfile: Dockerfile.develop
container:
syncTarget: /src
sync:
- '**/Pages/**'
- '**/Views/**'
- '**/wwwroot/**'
- '!**/*.{sln,csproj}'
command:
- dotnet
- run
- --no-restore
- --no-build
- --no-launch-profile
- -c
- ${Configuration:-Debug}
iterate:
processesToKill:
- dotnet
- vsdbg
buildCommands:
- - dotnet
- build
- --no-restore
- -c
- ${Configuration:-Debug}

+ 3
- 0
src/Services/Catalog/Catalog.API/values.dev.yaml View File

@ -0,0 +1,3 @@
ingress:
enabled: true
tls: []

+ 2
- 0
src/Services/Catalog/Catalog.FunctionalTests/Catalog.FunctionalTests.csproj View File

@ -33,6 +33,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="2.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.2.0" />
<PackageReference Include="xunit" Version="2.4.1" />


+ 2
- 0
src/Services/Catalog/Catalog.UnitTests/Catalog.UnitTests.csproj View File

@ -7,6 +7,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="2.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">


+ 14
- 0
src/Services/Identity/Identity.API/.dockerignore View File

@ -0,0 +1,14 @@
.dockerignore
.git
.gitignore
.vs
.vscode
**/*.*proj.user
**/azds.yaml
**/bin
**/charts
**/Dockerfile
**/Dockerfile.develop
**/obj
**/secrets.dev.yaml
**/values.dev.yaml

+ 31
- 0
src/Services/Identity/Identity.API/Devspaces/DevspacesRedirectUriValidator.cs View File

@ -0,0 +1,31 @@
using IdentityServer4.Models;
using IdentityServer4.Validation;
using Microsoft.Extensions.Logging;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Services.Identity.API.Devspaces
{
public class DevspacesRedirectUriValidator : IRedirectUriValidator
{
private readonly ILogger _logger;
public DevspacesRedirectUriValidator(ILogger<DevspacesRedirectUriValidator> logger)
{
_logger = logger;
}
public Task<bool> IsPostLogoutRedirectUriValidAsync(string requestedUri, Client client)
{
_logger.LogInformation($"Client {client.ClientName} used post logout uri {requestedUri}.");
return Task.FromResult(true);
}
public Task<bool> IsRedirectUriValidAsync(string requestedUri, Client client)
{
_logger.LogInformation($"Client {client.ClientName} used redirect uri {requestedUri}.");
return Task.FromResult(true);
}
}
}

+ 20
- 0
src/Services/Identity/Identity.API/Devspaces/IdentityDevspacesBuilderExtensions.cs View File

@ -0,0 +1,20 @@
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Microsoft.eShopOnContainers.Services.Identity.API.Devspaces
{
static class IdentityDevspacesBuilderExtensions
{
public static IIdentityServerBuilder AddDevspacesIfNeeded(this IIdentityServerBuilder builder, bool useDevspaces)
{
if (useDevspaces)
{
builder.AddRedirectUriValidator<DevspacesRedirectUriValidator>();
}
return builder;
}
}
}

+ 15
- 0
src/Services/Identity/Identity.API/Dockerfile.develop View File

@ -0,0 +1,15 @@
FROM microsoft/dotnet:2.2-sdk
ARG BUILD_CONFIGURATION=Debug
ENV ASPNETCORE_ENVIRONMENT=Development
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
EXPOSE 80
WORKDIR /src
COPY ["src/Services/Identity/Identity.API/Identity.API.csproj", "src/Services/Identity/Identity.API/"]
COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"]
RUN dotnet restore src/Services/Identity/Identity.API/Identity.API.csproj -nowarn:msb3202,nu1503
COPY . .
WORKDIR "/src/src/Services/Identity/Identity.API"
RUN dotnet build --no-restore -c $BUILD_CONFIGURATION
ENTRYPOINT ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"]

+ 2
- 2
src/Services/Identity/Identity.API/README.md View File

@ -2,10 +2,10 @@
Sample reference containerized application, cross-platform and microservices architecture.
Powered by Microsoft
#Overview
## Overview
This sample runs a microservices oriented application and a .net core Mvc application that consumes this services. You can find more information about how to set up docker in your machine in the global directory solution.
#Setup
## Setup
This service is a identity provider or STS (Security Token Service) currently implemented with IdentityServer 4 wrapping ASP.NET Identity underneath.
Check procedures on how to get the sample app started at the Wiki:


+ 2
- 0
src/Services/Identity/Identity.API/Startup.cs View File

@ -13,6 +13,7 @@ using Microsoft.eShopOnContainers.Services.Identity.API.Certificates;
using Microsoft.eShopOnContainers.Services.Identity.API.Data;
using Microsoft.eShopOnContainers.Services.Identity.API.Models;
using Microsoft.eShopOnContainers.Services.Identity.API.Services;
using Microsoft.eShopOnContainers.Services.Identity.API.Devspaces;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
@ -85,6 +86,7 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API
x.IssuerUri = "null";
x.Authentication.CookieLifetime = TimeSpan.FromHours(2);
})
.AddDevspacesIfNeeded(Configuration.GetValue("EnableDevspaces", false))
.AddSigningCredential(Certificate.Get())
.AddAspNetIdentity<ApplicationUser>()
.AddConfigurationStore(options =>


+ 3
- 3
src/Services/Identity/Identity.API/Views/Consent/Index.cshtml View File

@ -16,7 +16,7 @@
<div class="row">
<div class="col-sm-8">
@Html.Partial("_ValidationSummary")
<partial name="_ValidationSummary"/>
<form asp-action="Index" class="consent-form">
<input type="hidden" asp-for="ReturnUrl" />
@ -33,7 +33,7 @@
<ul class="list-group">
@foreach (var scope in Model.IdentityScopes)
{
@Html.Partial("_ScopeListItem", scope)
<partial name="_ScopeListItem" model="scope"/>
}
</ul>
</div>
@ -49,7 +49,7 @@
<ul class="list-group">
@foreach (var scope in Model.ResourceScopes)
{
@Html.Partial("_ScopeListItem", scope)
<partial name="_ScopeListItem" model="scope"/>
}
</ul>
</div>


+ 1
- 1
src/Services/Identity/Identity.API/Views/Shared/_LoginPartial.cshtml View File

@ -7,7 +7,7 @@
@if (SignInManager.IsSignedIn(User))
{
<form asp-area="" asp-controller="Account" asp-action="LogOff" method="post" id="logoutForm" class="navbar-right">
<form asp-area="" asp-controller="Account" asp-action="Logout" method="post" id="logoutForm" class="navbar-right">
<ul class="nav navbar-nav navbar-right">
<li>
<a asp-area="" asp-controller="Manage" asp-action="Index" title="Manage">Hello @UserManager.GetUserName(User)!</a>


+ 56
- 0
src/Services/Identity/Identity.API/azds.yaml View File

@ -0,0 +1,56 @@
kind: helm-release
apiVersion: 1.1
build:
context: ..\..\..\..
dockerfile: Dockerfile
install:
chart: ../../../../k8s/helm/identity-api
set:
replicaCount: 1
image:
tag: $(tag)
pullPolicy: Never
ingress:
annotations:
kubernetes.io/ingress.class: traefik-azds
hosts:
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values:
- values.dev.yaml?
- secrets.dev.yaml?
- inf.yaml
- app.yaml
configurations:
develop:
build:
useGitIgnore: true
dockerfile: Dockerfile.develop
args:
BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug}
container:
sync:
- '**/Pages/**'
- '**/Views/**'
- '**/wwwroot/**'
- '!**/*.{sln,csproj}'
command:
- dotnet
- run
- --no-restore
- --no-build
- --no-launch-profile
- -c
- ${BUILD_CONFIGURATION:-Debug}
iterate:
processesToKill:
- dotnet
- vsdbg
buildCommands:
- - dotnet
- build
- --no-restore
- -c
- ${BUILD_CONFIGURATION:-Debug}

+ 1
- 0
src/Services/Identity/Identity.API/values.dev.yaml View File

@ -0,0 +1 @@
enableDevspaces: "true"

+ 17
- 0
src/Services/Location/Locations.API/Dockerfile.develop View File

@ -0,0 +1,17 @@
FROM microsoft/dotnet:2.2-sdk
ARG BUILD_CONFIGURATION=Debug
ENV ASPNETCORE_ENVIRONMENT=Development
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
EXPOSE 80
WORKDIR /src
COPY ["src/Services/Location/Locations.API/Locations.API.csproj", "src/Services/Location/Locations.API/"]
COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"]
COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"]
COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"]
RUN dotnet restore src/Services/Location/Locations.API/Locations.API.csproj -nowarn:msb3202,nu1503
COPY . .
WORKDIR "/src/src/Services/Location/Locations.API"
RUN dotnet build --no-restore -c $BUILD_CONFIGURATION
ENTRYPOINT ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"]

+ 2
- 1
src/Services/Location/Locations.API/Startup.cs View File

@ -77,7 +77,8 @@ namespace Microsoft.eShopOnContainers.Services.Locations.API
var factory = new ConnectionFactory()
{
HostName = Configuration["EventBusConnection"]
HostName = Configuration["EventBusConnection"],
DispatchConsumersAsync = true
};
if (!string.IsNullOrEmpty(Configuration["EventBusUserName"]))


+ 56
- 0
src/Services/Location/Locations.API/azds.yaml View File

@ -0,0 +1,56 @@
kind: helm-release
apiVersion: 1.1
build:
context: ..\..\..\..
dockerfile: Dockerfile
install:
chart: ../../../../k8s/helm/locations-api
set:
replicaCount: 1
image:
tag: $(tag)
pullPolicy: Never
ingress:
annotations:
kubernetes.io/ingress.class: traefik-azds
hosts:
- $(spacePrefix)eshop$(hostSuffix)
inf:
k8s:
dns: $(spacePrefix)eshop$(hostSuffix)
values:
- values.dev.yaml?
- secrets.dev.yaml?
- inf.yaml
- app.yaml
configurations:
develop:
build:
useGitIgnore: true
dockerfile: Dockerfile.develop
args:
BUILD_CONFIGURATION: ${BUILD_CONFIGURATION:-Debug}
container:
sync:
- '**/Pages/**'
- '**/Views/**'
- '**/wwwroot/**'
- '!**/*.{sln,csproj}'
command:
- dotnet
- run
- --no-restore
- --no-build
- --no-launch-profile
- -c
- ${BUILD_CONFIGURATION:-Debug}
iterate:
processesToKill:
- dotnet
- vsdbg
buildCommands:
- - dotnet
- build
- --no-restore
- -c
- ${BUILD_CONFIGURATION:-Debug}

+ 3
- 0
src/Services/Location/Locations.API/values.dev.yaml View File

@ -0,0 +1,3 @@
ingress:
enabled: true
tls: []

+ 2
- 0
src/Services/Location/Locations.FunctionalTests/Locations.FunctionalTests.csproj View File

@ -17,6 +17,8 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.App" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="2.2.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.9.0" />
<PackageReference Include="Microsoft.AspNetCore.TestHost" Version="2.2.0" />
<PackageReference Include="xunit" Version="2.4.1" />


+ 18
- 0
src/Services/Marketing/Marketing.API/Dockerfile.develop View File

@ -0,0 +1,18 @@
FROM microsoft/dotnet:2.2-sdk
ARG BUILD_CONFIGURATION=Debug
ENV ASPNETCORE_ENVIRONMENT=Development
ENV DOTNET_USE_POLLING_FILE_WATCHER=true
EXPOSE 80
WORKDIR /src
COPY ["src/Services/Marketing/Marketing.API/Marketing.API.csproj", "src/Services/Marketing/Marketing.API/"]
COPY ["src/BuildingBlocks/EventBus/EventBus/EventBus.csproj", "src/BuildingBlocks/EventBus/EventBus/"]
COPY ["src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj", "src/BuildingBlocks/EventBus/EventBusRabbitMQ/"]
COPY ["src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj", "src/BuildingBlocks/EventBus/EventBusServiceBus/"]
COPY ["src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj", "src/BuildingBlocks/WebHostCustomization/WebHost.Customization/"]
RUN dotnet restore src/Services/Marketing/Marketing.API/Marketing.API.csproj -nowarn:msb3202,nu1503
COPY . .
WORKDIR "/src/src/Services/Marketing/Marketing.API"
RUN dotnet build --no-restore -c $BUILD_CONFIGURATION
ENTRYPOINT ["dotnet", "run", "--no-build", "--no-launch-profile", "-c", "$BUILD_CONFIGURATION", "--"]

+ 2
- 1
src/Services/Marketing/Marketing.API/Startup.cs View File

@ -101,7 +101,8 @@
var factory = new ConnectionFactory()
{
HostName = Configuration["EventBusConnection"]
HostName = Configuration["EventBusConnection"],
DispatchConsumersAsync = true
};
if (!string.IsNullOrEmpty(Configuration["EventBusUserName"]))


Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save