Merge pull request #1 from dotnet-architecture/dev

Pull from base
This commit is contained in:
Gajendra Babu Thokala [MSFT] 2019-11-17 13:20:35 -08:00 committed by GitHub
commit 584cc59823
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
365 changed files with 20920 additions and 40619 deletions

View File

@ -5,14 +5,11 @@
.vs
.vscode
docker-compose*.yml
docker-compose.dcproj
*.sln
*.md
hosts
LICENSE
*.testsettings
vsts-docs
test
ServiceFabric
readme
k8s

View File

@ -22,6 +22,7 @@ Dev branch contains the latest "stable" code, and their images are tagged with `
[![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**.
**Note for Pull Requests (PRs)**: We accept pull request from the community. When doing it, please do it onto the **DEV branch** which is the consolidated work-in-progress branch. Do not request it onto Master branch, if possible.
@ -29,7 +30,14 @@ Dev branch contains the latest "stable" code, and their images are tagged with `
**NEWS / ANNOUNCEMENTS**
Do you want to be up-to-date on .NET Architecture guidance and reference apps like eShopOnContainers? --> Subscribe by "WATCHING" this new GitHub repo: https://github.com/dotnet-architecture/News
## Update to .NET Core 3
> There's currently an update to .NET Core 3 going on in the branch [features/migration-dotnet3](https://github.com/dotnet-architecture/eShopOnContainers/tree/features/migration-dotnet3).
>
> You can monitor this branch, but it's being changed frequently, community contributions will be accepted once it's officially released.
## Updated for .NET Core 2.2 "wave" of technologies
eShopOnContainers is updated to .NET Core 2.x (currently updated to 2.2) "wave" of technologies. Not just compilation but also new recommended code in EF Core, ASP.NET Core, and other new related versions.
The **dockerfiles** in the solution have also been updated and now support [**Docker Multi-Stage**](https://blogs.msdn.microsoft.com/stevelasker/2017/09/11/net-and-multistage-dockerfiles/) since mid-December 2017.
@ -37,6 +45,7 @@ The **dockerfiles** in the solution have also been updated and now support [**Do
>**PLEASE** Read our [branch guide](./branch-guide.md) to know about our branching policy
> ### DISCLAIMER
>
> **IMPORTANT:** The current state of this sample application is **BETA**, because we are constantly evolving towards newly released technologies. Therefore, many areas could be improved and change significantly while refactoring the current code and implementing new features. Feedback with improvements and pull requests from the community will be highly appreciated and accepted.
>
> This reference application proposes a simplified microservice oriented architecture implementation to introduce technologies like .NET Core with Docker containers through a comprehensive application. The chosen domain is eShop/eCommerce but simply because it is a well-known domain by most people/developers.
@ -46,11 +55,11 @@ However, this sample application should not be considered as an "eCommerce refer
![image](https://user-images.githubusercontent.com/1712635/40397331-059a7ec6-5de7-11e8-8542-a597eca16fef.png)
> Read the planned <a href='https://github.com/dotnet/eShopOnContainers/wiki/01.-Roadmap-and-Milestones-for-future-releases'>Roadmap and Milestones for future releases of eShopOnContainers</a> within the Wiki for further info about possible new implementations and provide feedback at the <a href='https://github.com/dotnet/eShopOnContainers/issues'>ISSUES section</a> if you'd like to see any specific scenario implemented or improved. Also, feel free to discuss on any current issue.
> Read the planned <a href='https://github.com/dotnet-architecture/eShopOnContainers/wiki/Roadmap'>Roadmap</a> within the Wiki for further info about possible new implementations and provide feedback at the <a href='https://github.com/dotnet/eShopOnContainers/issues'>ISSUES section</a> if you'd like to see any specific scenario implemented or improved. Also, feel free to discuss on any current issue.
### Architecture overview
This reference application is cross-platform at the server and client side, thanks to .NET Core services capable of running on Linux or Windows containers depending on your Docker host, and to Xamarin for mobile apps running on Android, iOS or Windows/UWP plus any browser for the client web apps.
The architecture proposes a microservice oriented architecture implementation with multiple autonomous microservices (each one owning its own data/db) and implementing different approaches within each microservice (simple CRUD vs. DDD/CQRS patterns) using Http as the communication protocol between the client apps and the microservices and supports asynchronous communication for data updates propagation across multiple services based on Integration Events and an Event Bus (a light message broker, to choose between RabbitMQ or Azure Service Bus, underneath) plus other features defined at the <a href='https://github.com/dotnet/eShopOnContainers/wiki/01.-Roadmap-and-Milestones-for-future-releases'>roadmap</a>.
The architecture proposes a microservice oriented architecture implementation with multiple autonomous microservices (each one owning its own data/db) and implementing different approaches within each microservice (simple CRUD vs. DDD/CQRS patterns) using Http as the communication protocol between the client apps and the microservices and supports asynchronous communication for data updates propagation across multiple services based on Integration Events and an Event Bus (a light message broker, to choose between RabbitMQ or Azure Service Bus, underneath) plus other features defined at the <a href='https://github.com/dotnet-architecture/eShopOnContainers/wiki/Roadmap'>roadmap</a>.
<p>
<img src="img/eshop_logo.png">
<img src="https://user-images.githubusercontent.com/1712635/38758862-d4b42498-3f27-11e8-8dad-db60b0fa05d3.png">
@ -83,8 +92,8 @@ The architecture proposes a microservice oriented architecture implementation wi
> ### Important Note on EventBus
> In this solution's current EventBus is a simplified implementation, mainly used for learning purposes (development and testing), so it doesn't handle all production scenarios, most notably on error handling. <p>
> The following forks provide production environment level implementation examples with eShopOnContainers :
> * Implementation with [CAP](https://github.com/dotnetcore/CAP) : https://github.com/yang-xiaodong/eShopOnContainers
> * Implementation with [NServiceBus](https://github.com/Particular/NServiceBus) : https://github.com/Particular/eShopOnContainers
> * Implementation with [CAP](https://github.com/dotnetcore/CAP) : https://github.com/yang-xiaodong/eShopOnContainers
## Related documentation and guidance
While developing this reference application, we've been creating a reference <b>Guide/eBook</b> focusing on <b>architecting and developing containerized and microservice based .NET Applications</b> (download link available below) which explains in detail how to develop this kind of architectural style (microservices, Docker containers, Domain-Driven Design for certain microservices) plus other simpler architectural styles, like monolithic apps that can also live as Docker containers.
@ -95,8 +104,8 @@ You can download them and start reviewing these Guides/eBooks here:
| Architecting & Developing | Containers Lifecycle & CI/CD | App patterns with Xamarin.Forms |
| ------------ | ------------| ------------|
| <a href='https://aka.ms/microservicesebook'><img src="img/ebook_arch_dev_microservices_containers_cover.png"> </a> | <a href='https://aka.ms/dockerlifecycleebook'> <img src="img/ebook_containers_lifecycle.png"> </a> | <a href='https://aka.ms/xamarinpatternsebook'> <img src="img/xamarin-enterprise-patterns-ebook-cover-small.png"> </a> |
| <sup> <a href='https://aka.ms/microservicesebook'>**Download .PDF** (v2.2 Edition)</a> </sup> | <sup> <a href='https://aka.ms/dockerlifecycleebook'>**Download** </a> </sup> | <sup> <a href='https://aka.ms/xamarinpatternsebook'>**Download** </a> </sup> |
| <a href='https://aka.ms/microservicesebook'><img src="img/Microservices-cover-small.png"> </a> | <a href='https://aka.ms/dockerlifecycleebook'> <img src="img/DevOps-Cover-small.png"> </a> | <a href='https://aka.ms/xamarinpatternsebook'> <img src="img/xamarin-enterprise-patterns-ebook-cover-small.png"> </a> |
| <sup> <a href='https://aka.ms/microservicesebook'>**Download .PDF**</a> </sup> | <sup> <a href='https://aka.ms/dockerlifecycleebook'>**Download** </a> </sup> | <sup> <a href='https://aka.ms/xamarinpatternsebook'>**Download** </a> </sup> |
Download in other formats (**eReaders** like **MOBI**, **EPUB**) and other eBooks at the [.NET Architecture center](http://dot.net/architecture).
@ -129,25 +138,20 @@ 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 (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
### CLI and Windows based
For those who prefer the CLI on Windows, using dotnet CLI, docker CLI and VS Code for Windows:
https://github.com/dotnet/eShopOnContainers/wiki/03.-Setting-the-eShopOnContainers-solution-up-in-a-Windows-CLI-environment-(dotnet-CLI,-Docker-CLI-and-VS-Code)
### Windows based (CLI and Visual Studio)
### CLI and Mac based
For those who prefer the CLI on a Mac, using dotnet CLI, docker CLI and VS Code for Mac:
https://github.com/dotnet-architecture/eShopOnContainers/wiki/04.-Setting-eShopOnContainer-solution-up-in-a-Mac,-VS-for-Mac-or-with-CLI-environment--(dotnet-CLI,-Docker-CLI-and-VS-Code)
<https://github.com/dotnet-architecture/eShopOnContainers/wiki/Windows-setup>
### Mac based (CLI ans Visual Studio for Mac)
<https://github.com/dotnet-architecture/eShopOnContainers/wiki/Mac-setup>
## Orchestrators: Kubernetes and Service Fabric
See at the [Wiki](https://github.com/dotnet-architecture/eShopOnContainers/wiki) the posts on setup/instructions about how to deploy to Kubernetes or Service Fabric in Azure (although you could also deploy to any other cloud or on-premises).
## Sending feedback and pull requests
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 VS or CLI environment):
https://github.com/dotnet/eShopOnContainers/issues/107

View File

@ -16,37 +16,14 @@ trigger:
- src/ApiGateways/Mobile.Bff.Shopping/aggregator/*
- src/ApiGateways/Web.Bff.Shopping/aggregator/*
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
- template: ../buildimages.yaml
parameters:
services: mobileshoppingapigw mobilemarketingapigw webshoppingapigw webmarketingapigw
registryEndpoint: $(registryEndpoint)
helmfrom: $(Build.SourcesDirectory)/k8s/helm
helmto: $(Build.ArtifactStagingDirectory)/k8s/helm
- template: ../multiarch.yaml
parameters:
image: ocelotapigw
branch: $(Build.SourceBranchName)
registryEndpoint: $(registryEndpoint)

View File

@ -1,5 +1,3 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
@ -12,34 +10,15 @@ trigger:
- src/BuildingBlocks/*
- src/Services/Basket/*
- k8s/helm/basket-api/*
steps:
- task: DockerCompose@0
displayName: Compose build basket
inputs:
dockerComposeCommand: 'build basket.api'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push basket
inputs:
dockerComposeCommand: 'push basket.api'
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:
- template: ../buildimages.yaml
parameters:
services: basket.api
registryEndpoint: $(registryEndpoint)
helmfrom: $(Build.SourcesDirectory)/k8s/helm
helmto: $(Build.ArtifactStagingDirectory)/k8s/helm
- template: ../multiarch.yaml
parameters:
image: basket.api
branch: $(Build.SourceBranchName)
registryEndpoint: $(registryEndpoint)

View File

@ -0,0 +1,92 @@
parameters:
services: ''
registryEndpoint: ''
helmfrom: ''
helmto: ''
jobs:
- job: BuildContainersForPR_Linux
condition: eq('${{ variables['Build.Reason'] }}', 'PullRequest')
pool:
vmImage: 'ubuntu-16.04'
steps:
- bash: docker-compose build ${{ parameters.services }}
displayName: Create multiarch manifest
env:
TAG: ${{ variables['Build.SourceBranchName'] }}
- job: BuildContainersForPR_Windows
condition: eq('${{ variables['Build.Reason'] }}', 'PullRequest')
pool:
vmImage: 'windows-2019'
steps:
- bash: docker-compose build ${{ parameters.services }}
displayName: Create multiarch manifest
env:
TAG: ${{ variables['Build.SourceBranchName'] }}
PLATFORM: win
NODE_IMAGE: stefanscherer/node-windows:10
- job: BuildLinux
condition: ne('${{ variables['Build.Reason'] }}', 'PullRequest')
pool:
vmImage: 'ubuntu-16.04'
steps:
- task: DockerCompose@0
displayName: Compose build ${{ parameters.services }}
inputs:
dockerComposeCommand: 'build ${{ parameters.services }}'
containerregistrytype: Container Registry
dockerRegistryEndpoint: ${{ parameters.registryEndpoint }}
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=${{ variables['Build.SourceBranchName'] }}
- task: DockerCompose@0
displayName: Compose push ${{ parameters.images }}
inputs:
dockerComposeCommand: 'push ${{ parameters.services }}'
containerregistrytype: Container Registry
dockerRegistryEndpoint: ${{ parameters.registryEndpoint }}
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=${{ variables['Build.SourceBranchName'] }}
- task: CopyFiles@2
inputs:
sourceFolder: ${{ parameters.helmfrom }}
targetFolder: ${{ parameters.helmto }}
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: ${{ parameters.helmto }}
artifactName: helm
- job: BuildWindows
condition: ne('${{ variables['Build.Reason'] }}', 'PullRequest')
pool:
vmImage: 'windows-2019'
steps:
- task: DockerCompose@0
displayName: Compose build ${{ parameters.services }}
inputs:
dockerComposeCommand: 'build ${{ parameters.services }}'
containerregistrytype: Container Registry
dockerRegistryEndpoint: ${{ parameters.registryEndpoint }}
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=${{ variables['Build.SourceBranchName'] }}
PLATFORM=win
NODE_IMAGE=stefanscherer/node-windows:10
- task: DockerCompose@0
displayName: Compose push ${{ parameters.services }}
inputs:
dockerComposeCommand: 'push ${{ parameters.services }}'
containerregistrytype: Container Registry
dockerRegistryEndpoint: ${{ parameters.registryEndpoint }}
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=${{ variables['Build.SourceBranchName'] }}
PLATFORM=win

View File

@ -1,5 +1,3 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
@ -12,34 +10,15 @@ trigger:
- src/BuildingBlocks/*
- src/Services/Catalog/*
- k8s/helm/catalog-api/*
steps:
- task: DockerCompose@0
displayName: Compose build catalog
inputs:
dockerComposeCommand: 'build catalog.api'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push catalog
inputs:
dockerComposeCommand: 'push catalog.api'
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:
- template: ../buildimages.yaml
parameters:
services: catalog.api
registryEndpoint: $(registryEndpoint)
helmfrom: $(Build.SourcesDirectory)/k8s/helm
helmto: $(Build.ArtifactStagingDirectory)/k8s/helm
- template: ../multiarch.yaml
parameters:
image: catalog.api
branch: $(Build.SourceBranchName)
registryEndpoint: $(registryEndpoint)

View File

@ -1,5 +1,3 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
@ -12,34 +10,15 @@ trigger:
- src/BuildingBlocks/*
- src/Services/Identity/*
- k8s/helm/identity-api/*
steps:
- task: DockerCompose@0
displayName: Compose build identity
inputs:
dockerComposeCommand: 'build identity.api'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push identity
inputs:
dockerComposeCommand: 'push identity.api'
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:
- template: ../buildimages.yaml
parameters:
services: identity.api
registryEndpoint: $(registryEndpoint)
helmfrom: $(Build.SourcesDirectory)/k8s/helm
helmto: $(Build.ArtifactStagingDirectory)/k8s/helm
- template: ../multiarch.yaml
parameters:
image: identity.api
branch: $(Build.SourceBranchName)
registryEndpoint: $(registryEndpoint)

View File

@ -1,5 +1,3 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
@ -11,35 +9,16 @@ trigger:
include:
- src/BuildingBlocks/*
- src/Services/Location/*
- k8s/helm/locations-api/*
steps:
- task: DockerCompose@0
displayName: Compose build locations
inputs:
dockerComposeCommand: 'build locations.api'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push locations
inputs:
dockerComposeCommand: 'push locations.api'
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
- k8s/helm/locations-api/*
jobs:
- template: ../buildimages.yaml
parameters:
services: locations.api
registryEndpoint: $(registryEndpoint)
helmfrom: $(Build.SourcesDirectory)/k8s/helm
helmto: $(Build.ArtifactStagingDirectory)/k8s/helm
- template: ../multiarch.yaml
parameters:
image: locations.api
branch: $(Build.SourceBranchName)
registryEndpoint: $(registryEndpoint)

View File

@ -1,5 +1,3 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
@ -11,35 +9,16 @@ trigger:
include:
- src/BuildingBlocks/*
- src/Services/Marketing/*
- k8s/helm/marketing-api/*
steps:
- task: DockerCompose@0
displayName: Compose build marketing
inputs:
dockerComposeCommand: 'build marketing.api'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push marketing
inputs:
dockerComposeCommand: 'push marketing.api'
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
- k8s/helm/marketing-api/*
jobs:
- template: ../buildimages.yaml
parameters:
services: marketing.api
registryEndpoint: $(registryEndpoint)
helmfrom: $(Build.SourcesDirectory)/k8s/helm
helmto: $(Build.ArtifactStagingDirectory)/k8s/helm
- template: ../multiarch.yaml
parameters:
image: marketing.api
branch: $(Build.SourceBranchName)
registryEndpoint: $(registryEndpoint)

View File

@ -1,5 +1,3 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
@ -10,35 +8,17 @@ trigger:
paths:
include:
- src/ApiGateways/Mobile.Bff.Shopping/aggregator/*
- k8s/helm/mobileshoppingagg/*
steps:
- task: DockerCompose@0
displayName: Compose build mobileshoppingagg
inputs:
dockerComposeCommand: 'build mobileshoppingagg'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push mobileshoppingagg
inputs:
dockerComposeCommand: 'push mobileshoppingagg'
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
- k8s/helm/mobileshoppingagg/*
jobs:
- template: ../buildimages.yaml
parameters:
services: mobileshoppingagg
registryEndpoint: $(registryEndpoint)
helmfrom: $(Build.SourcesDirectory)/k8s/helm
helmto: $(Build.ArtifactStagingDirectory)/k8s/helm
- template: ../multiarch.yaml
parameters:
image: mobileshoppingagg
branch: $(Build.SourceBranchName)
registryEndpoint: $(registryEndpoint)

View File

@ -0,0 +1,30 @@
parameters:
image: ''
branch: ''
registry: 'eshop'
registryEndpoint: ''
jobs:
- job: manifest
condition: and(succeeded(),ne('${{ variables['Build.Reason'] }}', 'PullRequest'))
dependsOn:
- BuildWindows
- BuildLinux
pool:
vmImage: 'Ubuntu 16.04'
steps:
- task: Docker@1
displayName: Docker Login
inputs:
command: login
containerregistrytype: 'Container Registry'
dockerRegistryEndpoint: ${{ parameters.registryEndpoint }}
- bash: |
mkdir -p ~/.docker
sed '$ s/.$//' $DOCKER_CONFIG/config.json > ~/.docker/config.json
echo ',"experimental": "enabled" }' >> ~/.docker/config.json
docker --config ~/.docker manifest create ${{ parameters.registry }}/${{ parameters.image }}:${{ parameters.branch }} ${{ parameters.registry }}/${{ parameters.image }}:linux-${{ parameters.branch }} ${{ parameters.registry }}/${{ parameters.image }}:win-${{ parameters.branch }}
docker --config ~/.docker manifest create ${{ parameters.registry }}/${{ parameters.image }}:latest ${{ parameters.registry }}/${{ parameters.image }}:linux-latest ${{ parameters.registry }}/${{ parameters.image }}:win-latest
docker --config ~/.docker manifest push ${{ parameters.registry }}/${{ parameters.image }}:${{ parameters.branch }}
docker --config ~/.docker manifest push ${{ parameters.registry }}/${{ parameters.image }}:latest
displayName: Create multiarch manifest

View File

@ -1,5 +1,3 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
@ -14,34 +12,15 @@ trigger:
- k8s/helm/ordering-api/*
- k8s/helm/ordering-backgroundtasks/*
- k8s/helm/ordering-signalrhub/*
steps:
- task: DockerCompose@0
displayName: Compose build ordering
inputs:
dockerComposeCommand: 'build ordering.api ordering.backgroundtasks ordering.signalrhub'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push ordering
inputs:
dockerComposeCommand: 'push ordering.api ordering.backgroundtasks ordering.signalrhub'
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:
- template: ../buildimages.yaml
parameters:
services: ordering.api
registryEndpoint: $(registryEndpoint)
helmfrom: $(Build.SourcesDirectory)/k8s/helm
helmto: $(Build.ArtifactStagingDirectory)/k8s/helm
- template: ../multiarch.yaml
parameters:
image: ordering.api
branch: $(Build.SourceBranchName)
registryEndpoint: $(registryEndpoint)

View File

@ -1,5 +1,3 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
@ -12,34 +10,15 @@ trigger:
- src/BuildingBlocks/*
- src/Services/Payment/*
- k8s/helm/payment-api/*
steps:
- task: DockerCompose@0
displayName: Compose build payment
inputs:
dockerComposeCommand: 'build payment.api'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push payment
inputs:
dockerComposeCommand: 'push payment.api'
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:
- template: ../buildimages.yaml
parameters:
services: payment.api
registryEndpoint: $(registryEndpoint)
helmfrom: $(Build.SourcesDirectory)/k8s/helm
helmto: $(Build.ArtifactStagingDirectory)/k8s/helm
- template: ../multiarch.yaml
parameters:
image: payment.api
branch: $(Build.SourceBranchName)
registryEndpoint: $(registryEndpoint)

View File

@ -1,5 +1,3 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
@ -10,35 +8,16 @@ trigger:
paths:
include:
- src/ApiGateways/Web.Bff.Shopping/aggregator/*
- k8s/helm/webshoppingagg/*
steps:
- task: DockerCompose@0
displayName: Compose build webshoppingagg
inputs:
dockerComposeCommand: 'build webshoppingagg'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push webshoppingagg
inputs:
dockerComposeCommand: 'push webshoppingagg'
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
- k8s/helm/webshoppingagg/*
jobs:
- template: ../buildimages.yaml
parameters:
services: webshoppingagg
registryEndpoint: $(registryEndpoint)
helmfrom: $(Build.SourcesDirectory)/k8s/helm
helmto: $(Build.ArtifactStagingDirectory)/k8s/helm
- template: ../multiarch.yaml
parameters:
image: webshoppingagg
branch: $(Build.SourceBranchName)
registryEndpoint: $(registryEndpoint)

View File

@ -1,5 +1,3 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
@ -11,35 +9,16 @@ trigger:
include:
- src/BuildingBlocks/*
- src/Services/Webhooks/*
- k8s/helm/webhooks-api/*
steps:
- task: DockerCompose@0
displayName: Compose build webhooks
inputs:
dockerComposeCommand: 'build webhooks.api'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push webhooks
inputs:
dockerComposeCommand: 'push webhooks.api'
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
- k8s/helm/webhooks-api/*
jobs:
- template: ../buildimages.yaml
parameters:
services: webhooks.api
registryEndpoint: $(registryEndpoint)
helmfrom: $(Build.SourcesDirectory)/k8s/helm
helmto: $(Build.ArtifactStagingDirectory)/k8s/helm
- template: ../multiarch.yaml
parameters:
image: webhooks.api
branch: $(Build.SourceBranchName)
registryEndpoint: $(registryEndpoint)

View File

@ -1,5 +1,3 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
@ -11,35 +9,16 @@ trigger:
include:
- src/BuildingBlocks/*
- src/Web/WebhookClient/*
- k8s/helm/webhooks-web/*
steps:
- task: DockerCompose@0
displayName: Compose build webhooks.client
inputs:
dockerComposeCommand: 'build webhooks.client'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push webhooks.client
inputs:
dockerComposeCommand: 'push webhooks.client'
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
- k8s/helm/webhooks-web/*
jobs:
- template: ../buildimages.yaml
parameters:
services: webhooks.client
registryEndpoint: $(registryEndpoint)
helmfrom: $(Build.SourcesDirectory)/k8s/helm
helmto: $(Build.ArtifactStagingDirectory)/k8s/helm
- template: ../multiarch.yaml
parameters:
image: webhooks.client
branch: $(Build.SourceBranchName)
registryEndpoint: $(registryEndpoint)

View File

@ -1,5 +1,3 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
@ -11,35 +9,16 @@ trigger:
include:
- src/BuildingBlocks/*
- src/Web/WebMVC/*
- k8s/helm/webmvc/*
steps:
- task: DockerCompose@0
displayName: Compose build webmvc
inputs:
dockerComposeCommand: 'build webmvc'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push webmvc
inputs:
dockerComposeCommand: 'push webmvc'
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
- k8s/helm/webmvc/*
jobs:
- template: ../buildimages.yaml
parameters:
services: webmvc
registryEndpoint: $(registryEndpoint)
helmfrom: $(Build.SourcesDirectory)/k8s/helm
helmto: $(Build.ArtifactStagingDirectory)/k8s/helm
- template: ../multiarch.yaml
parameters:
image: webmvc
branch: $(Build.SourceBranchName)
registryEndpoint: $(registryEndpoint)

View File

@ -1,5 +1,3 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
@ -12,34 +10,15 @@ trigger:
- src/BuildingBlocks/*
- src/Web/WebSPA/*
- k8s/helm/webspa/*
steps:
- task: DockerCompose@0
displayName: Compose build webspa
inputs:
dockerComposeCommand: 'build webspa'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push webspa
inputs:
dockerComposeCommand: 'push webspa'
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:
- template: ../buildimages.yaml
parameters:
services: webspa
registryEndpoint: $(registryEndpoint)
helmfrom: $(Build.SourcesDirectory)/k8s/helm
helmto: $(Build.ArtifactStagingDirectory)/k8s/helm
- template: ../multiarch.yaml
parameters:
image: webspa
branch: $(Build.SourceBranchName)
registryEndpoint: $(registryEndpoint)

View File

@ -1,5 +1,3 @@
pool:
vmImage: 'ubuntu-16.04'
variables:
registryEndpoint: eshop-registry
trigger:
@ -11,35 +9,16 @@ trigger:
include:
- src/BuildingBlocks/*
- src/Web/WebStatus/*
- k8s/helm/webstatus/*
steps:
- task: DockerCompose@0
displayName: Compose build webstatus
inputs:
dockerComposeCommand: 'build webstatus'
containerregistrytype: Container Registry
dockerRegistryEndpoint: $(registryEndpoint)
dockerComposeFile: docker-compose.yml
qualifyImageNames: true
projectName: ""
dockerComposeFileArgs: |
TAG=$(Build.SourceBranchName)
- task: DockerCompose@0
displayName: Compose push webstatus
inputs:
dockerComposeCommand: 'push webstatus'
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
- k8s/helm/webstatus/*
jobs:
- template: ../buildimages.yaml
parameters:
services: webstatus
registryEndpoint: $(registryEndpoint)
helmfrom: $(Build.SourcesDirectory)/k8s/helm
helmto: $(Build.ArtifactStagingDirectory)/k8s/helm
- template: ../multiarch.yaml
parameters:
image: webstatus
branch: $(Build.SourceBranchName)
registryEndpoint: $(registryEndpoint)

View File

@ -110,6 +110,8 @@ services:
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
- UseLoadTest=${USE_LOADTEST:-False}
- Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ=Verbose
- Serilog__MinimumLevel__Override__Ordering.API=Verbose
ports:
- "5102:80" # Important: In a production environment your should remove the external port (5102) kept here for microservice debugging purposes.
# The API Gateway redirects and access through the internal port (80).
@ -130,6 +132,7 @@ services:
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
- UseLoadTest=${USE_LOADTEST:-False}
- Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ=Verbose
ports:
- "5111:80"
@ -168,6 +171,8 @@ services:
- AzureServiceBusEnabled=False
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}
- Serilog__MinimumLevel__Override__Payment.API.IntegrationEvents.EventHandling=Verbose
- Serilog__MinimumLevel__Override__Microsoft.eShopOnContainers.BuildingBlocks.EventBusRabbitMQ=Verbose
ports:
- "5108:80" # Important: In a production environment your should remove the external port (5108) kept here for microservice debugging purposes.
# The API Gateway redirects and access through the internal port (80).
@ -326,40 +331,40 @@ services:
environment:
- ASPNETCORE_ENVIRONMENT=Production
- ASPNETCORE_URLS=http://0.0.0.0:80
- HealthChecks-UI__HealthChecks__1__Name=WebMVC HTTP Check
- HealthChecks-UI__HealthChecks__1__Uri=http://webmvc/hc
- HealthChecks-UI__HealthChecks__2__Name=WebSPA HTTP Check
- HealthChecks-UI__HealthChecks__2__Uri=http://webspa/hc
- HealthChecks-UI__HealthChecks__3__Name=Web Shopping Aggregator GW HTTP Check
- HealthChecks-UI__HealthChecks__3__Uri=http://webshoppingagg/hc
- HealthChecks-UI__HealthChecks__4__Name=Mobile Shopping Aggregator HTTP Check
- HealthChecks-UI__HealthChecks__4__Uri=http://mobileshoppingagg/hc
- HealthChecks-UI__HealthChecks__5__Name=Mobile Shopping API GW HTTP Check
- HealthChecks-UI__HealthChecks__5__Uri=http://mobileshoppingapigw/hc
- HealthChecks-UI__HealthChecks__6__Name=Mobile Marketing API GW HTTP Check
- HealthChecks-UI__HealthChecks__6__Uri=http://mobilemarketingapigw/hc
- HealthChecks-UI__HealthChecks__7__Name=Web Shopping API GW HTTP Check
- HealthChecks-UI__HealthChecks__7__Uri=http://webshoppingapigw/hc
- HealthChecks-UI__HealthChecks__8__Name=Web Marketing API GW HTTP Check
- HealthChecks-UI__HealthChecks__8__Uri=http://webmarketingapigw/hc
- HealthChecks-UI__HealthChecks__9__Name=Ordering HTTP Check
- HealthChecks-UI__HealthChecks__9__Uri=http://ordering.api/hc
- HealthChecks-UI__HealthChecks__10__Name=Ordering HTTP Background Check
- HealthChecks-UI__HealthChecks__10__Uri=http://ordering.backgroundtasks/hc
- HealthChecks-UI__HealthChecks__11__Name=Basket HTTP Check
- HealthChecks-UI__HealthChecks__11__Uri=http://basket.api/hc
- HealthChecks-UI__HealthChecks__12__Name=Catalog HTTP Check
- HealthChecks-UI__HealthChecks__12__Uri=http://catalog.api/hc
- HealthChecks-UI__HealthChecks__13__Name=Identity HTTP Check
- HealthChecks-UI__HealthChecks__13__Uri=http://identity.api/hc
- HealthChecks-UI__HealthChecks__14__Name=Marketing HTTP Check
- HealthChecks-UI__HealthChecks__14__Uri=http://marketing.api/hc
- HealthChecks-UI__HealthChecks__15__Name=Locations HTTP Check
- HealthChecks-UI__HealthChecks__15__Uri=http://locations.api/hc
- HealthChecks-UI__HealthChecks__16__Name=Payments HTTP Check
- HealthChecks-UI__HealthChecks__16__Uri=http://payment.api/hc
- HealthChecks-UI__HealthChecks__17__Name=Ordering SignalRHub HTTP Check
- HealthChecks-UI__HealthChecks__17__Uri=http://ordering.signalrhub/hc
- HealthChecksUI__HealthChecks__0__Name=WebMVC HTTP Check
- HealthChecksUI__HealthChecks__0__Uri=http://webmvc/hc
- HealthChecksUI__HealthChecks__1__Name=WebSPA HTTP Check
- HealthChecksUI__HealthChecks__1__Uri=http://webspa/hc
- HealthChecksUI__HealthChecks__2__Name=Web Shopping Aggregator GW HTTP Check
- HealthChecksUI__HealthChecks__2__Uri=http://webshoppingagg/hc
- HealthChecksUI__HealthChecks__3__Name=Mobile Shopping Aggregator HTTP Check
- HealthChecksUI__HealthChecks__3__Uri=http://mobileshoppingagg/hc
- HealthChecksUI__HealthChecks__4__Name=Mobile Shopping API GW HTTP Check
- HealthChecksUI__HealthChecks__4__Uri=http://mobileshoppingapigw/hc
- HealthChecksUI__HealthChecks__5__Name=Mobile Marketing API GW HTTP Check
- HealthChecksUI__HealthChecks__5__Uri=http://mobilemarketingapigw/hc
- HealthChecksUI__HealthChecks__6__Name=Web Shopping API GW HTTP Check
- HealthChecksUI__HealthChecks__6__Uri=http://webshoppingapigw/hc
- HealthChecksUI__HealthChecks__7__Name=Web Marketing API GW HTTP Check
- HealthChecksUI__HealthChecks__7__Uri=http://webmarketingapigw/hc
- HealthChecksUI__HealthChecks__8__Name=Ordering HTTP Check
- HealthChecksUI__HealthChecks__8__Uri=http://ordering.api/hc
- HealthChecksUI__HealthChecks__9__Name=Ordering HTTP Background Check
- HealthChecksUI__HealthChecks__9__Uri=http://ordering.backgroundtasks/hc
- HealthChecksUI__HealthChecks__10__Name=Basket HTTP Check
- HealthChecksUI__HealthChecks__10__Uri=http://basket.api/hc
- HealthChecksUI__HealthChecks__11__Name=Catalog HTTP Check
- HealthChecksUI__HealthChecks__11__Uri=http://catalog.api/hc
- HealthChecksUI__HealthChecks__12__Name=Identity HTTP Check
- HealthChecksUI__HealthChecks__12__Uri=http://identity.api/hc
- HealthChecksUI__HealthChecks__13__Name=Marketing HTTP Check
- HealthChecksUI__HealthChecks__13__Uri=http://marketing.api/hc
- HealthChecksUI__HealthChecks__14__Name=Locations HTTP Check
- HealthChecksUI__HealthChecks__14__Uri=http://locations.api/hc
- HealthChecksUI__HealthChecks__15__Name=Payments HTTP Check
- HealthChecksUI__HealthChecks__15__Uri=http://payment.api/hc
- HealthChecksUI__HealthChecks__16__Name=Ordering SignalRHub HTTP Check
- HealthChecksUI__HealthChecks__16__Uri=http://ordering.signalrhub/hc
- OrderingBackgroundTasksUrl=http://ordering.backgroundtasks/hc
- ApplicationInsights__InstrumentationKey=${INSTRUMENTATION_KEY}
- OrchestratorType=${ORCHESTRATOR_TYPE}

View File

@ -20,17 +20,17 @@ services:
identity.api:
build:
args:
NODE_IMAGE: stefanscherer/node-windows:8.11
NODE_IMAGE: stefanscherer/node-windows:10
webspa:
build:
args:
NODE_IMAGE: stefanscherer/node-windows:8.11
NODE_IMAGE: stefanscherer/node-windows:10
webmvc:
build:
args:
NODE_IMAGE: stefanscherer/node-windows:8.11
NODE_IMAGE: stefanscherer/node-windows:10
networks:

View File

@ -6,7 +6,7 @@ services:
image: datalust/seq:latest
sql.data:
image: microsoft/mssql-server-linux:2017-latest
image: mcr.microsoft.com/mssql/server:2017-latest
nosql.data:
image: mongo
@ -214,6 +214,8 @@ services:
build:
context: .
dockerfile: src/Web/WebSPA/Dockerfile
args:
NODE_IMAGE: ${NODE_IMAGE:-node:8.11}
# depends_on:
# - webshoppingagg
# - webshoppingapigw

View File

@ -1,6 +0,0 @@
eShopOnContainers Knowledge Base
================================
This folder contains a set of posts created mostly from [issues on the repo](https://github.com/dotnet-architecture/eShopOnContainers/issues), in order to offer a brief introduction as well as links to deepen the knowledge on a given subject related to the application.
[Simplified CQRS and DDD](simplified-cqrs-ddd/post.md)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

View File

@ -1,93 +0,0 @@
Simplified CQRS and DDD
=======================
CQRS, for Command and Query Responsibility Segregation, is an architectural pattern that, in very simple terms, has two different ways to handle the application model.
**Commands** are responsible for **changing** the application state, i.e. creating, updating and deleting entities (data).
**Queries** are responsible for **reading** the application state, e.g. to display information to the user.
**Commands** are made thinking about the Domain rules, restrictions and transaction boundaries.
**Queries** are made thinking about the presentation layer, the client UI.
When handling **commands**, the application model is usually represented by DDD constructs, e.g. Root aggregates, entities, value objects, etc., and there are usually some sort of rules that restrict the allowed state changes, e.g. An order has to be paid before dispatching.
When handling **queries**, the application model is usually represented by entities and relations and can be read much like SQL queries to display information.
Queries don't change state, so they can be run as much as required and will always return the same values (as long as the application state hasn't changed), i.e. queries are "idempotent".
Why the separation? because the rules for **changing** the model can impose unnecessary constraints for **reading** the model, e.g. you might allow to change order items only before dispatching so the order is like the gate-keeper (root aggregate) to access the order items, but you might also want to view all orders for some catalog item, so you have to be able to access the order items first (in a read only way).
In this simplified CQRS approach both the DDD model and the query model use the same database.
**Commands** and **Queries** are located in the Application layer, because:
1. It's where the composition of domain root aggregates occur (commands) and
2. It's close to the UI requirements and has access to the whole database of the microservice (queries).
Ideally, root aggregates are ignorant of each other and it's the Application layer's responsibility to compose coordinated actions by means of domain events, because it knows about all root aggregates.
Regarding **queries**, in a similar analysis, the Application layer knows about all entities and relationships in the database, beyond the restrictions of the root aggregates.
Code
----
### CQRS
The CQRS pattern can be checked in the Ordering service:
Commands and queries are clearly separated in the application layer (Ordering.API).
**Solution Explorer [Ordering.API]:**
![](devenv_2018-05-22_18-00-24.png)
Commands are basically read only Data Transfer Objects (DTO) that contain all data that's required to execute the operation.
**CreateOrderCommand:**
![](devenv_2018-05-22_18-13-35.png)
Each command has a specific command handler that's responsible for executing the operations intended for the command.
**CreateOrderCommandHandler:**
![](devenv_2018-05-22_18-22-23.png)
In this case:
1. Creates an Order object (root aggregate)
2. Adds the order items using the root aggregate method
3. Adds the order through the repository
4. Saves the order
Queries, on the other hand, just return whatever the UI needs, could be a domain object or collections of specific DTOs.
**IOrderQueries:**
![](devenv_2018-05-22_18-40-25.png)
And they are implemented as plain SQL queries, in this case using [Dapper](http://dapper-tutorial.net/ as the ORM.
**OrderQueries:**
![](devenv_2018-05-22_18-48-36.png)
There can even be specific ViewModels or DTOs just to get the query results.
**OrderViewModel:**
![](devenv_2018-05-22_19-11-30.png)
### DDD
The DDD pattern can be checked in the domain layer (Ordering.Domain)
**Solution Explorer [Ordering.Domain + Ordering.Infrastructure]:**
![](devenv_2018-05-22_18-52-58.png)
There you can see the Buyer aggregate and the Order aggregate, as well as the repository implementations in Ordering.Infrastructure.
Command handlers from the application layer use the root aggregates from the Domain layer and the repository implementations from the Infrastructure layer, the latter through Dependency Injection.
Further reading
---------------
* **Issue #592 - [Question] Ordering Queries** <br/> https://github.com/dotnet-architecture/eShopOnContainers/issues/592
* **Applying simplified CQRS and DDD patterns in a microservice** <br/>
https://docs.microsoft.com/en-us/dotnet/standard/microservices-architecture/microservice-ddd-cqrs-patterns/apply-simplified-microservice-cqrs-ddd-patterns

Binary file not shown.

View File

@ -161,6 +161,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Mobile.Shopping.HttpAggrega
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Web.Shopping.HttpAggregator", "src\ApiGateways\Web.Bff.Shopping\aggregator\Web.Shopping.HttpAggregator.csproj", "{E39BD762-BC86-459D-B818-B6BF2D9F1352}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Devspaces.Support", "Devspaces.Support", "{ABBA561B-499B-48C0-8299-85D41E6E9E98}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Devspaces.Support", "src\BuildingBlocks\Devspaces.Support\Devspaces.Support.csproj", "{CB6D01A4-E597-4348-9570-FC8DB03B4267}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
@ -2039,6 +2043,54 @@ Global
{E39BD762-BC86-459D-B818-B6BF2D9F1352}.Release|x64.Build.0 = Release|Any CPU
{E39BD762-BC86-459D-B818-B6BF2D9F1352}.Release|x86.ActiveCfg = Release|Any CPU
{E39BD762-BC86-459D-B818-B6BF2D9F1352}.Release|x86.Build.0 = Release|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.AppStore|Any CPU.Build.0 = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.AppStore|ARM.ActiveCfg = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.AppStore|ARM.Build.0 = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.AppStore|iPhone.Build.0 = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.AppStore|x64.ActiveCfg = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.AppStore|x64.Build.0 = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.AppStore|x86.ActiveCfg = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.AppStore|x86.Build.0 = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Debug|ARM.ActiveCfg = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Debug|ARM.Build.0 = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Debug|iPhone.Build.0 = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Debug|x64.ActiveCfg = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Debug|x64.Build.0 = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Debug|x86.ActiveCfg = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Debug|x86.Build.0 = Debug|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Release|Any CPU.Build.0 = Release|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Release|ARM.ActiveCfg = Release|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Release|ARM.Build.0 = Release|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Release|iPhone.ActiveCfg = Release|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Release|iPhone.Build.0 = Release|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Release|x64.ActiveCfg = Release|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Release|x64.Build.0 = Release|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Release|x86.ActiveCfg = Release|Any CPU
{CB6D01A4-E597-4348-9570-FC8DB03B4267}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -2111,6 +2163,8 @@ Global
{0A328C44-4C4E-49BE-9FB4-9D851CEC28AC} = {56AD1FCA-6E16-4798-BF29-941C5B3277D2}
{98E0B3BA-6601-4C59-A9AA-24A00A17D835} = {A32A5254-BA36-46FC-8C75-F7B8FFE8FCD0}
{E39BD762-BC86-459D-B818-B6BF2D9F1352} = {424BC53E-17EA-4E12-BC07-64BAA927ABCB}
{ABBA561B-499B-48C0-8299-85D41E6E9E98} = {DB0EFB20-B024-4E5E-A75C-52143C131D25}
{CB6D01A4-E597-4348-9570-FC8DB03B4267} = {ABBA561B-499B-48C0-8299-85D41E6E9E98}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {25728519-5F0F-4973-8A64-0A81EB4EA8D9}

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

BIN
img/DevOps-Cover-small.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

BIN
img/Microservices-cover.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

BIN
img/eShopScreen.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 334 KiB

2
k8s/deploy-nodeports.ps1 Normal file
View File

@ -0,0 +1,2 @@
kubectl apply -f .\nodeports\rabbitmq-admin.yaml
kubectl apply -f .\nodeports\sql-services.yaml

View File

@ -29,7 +29,7 @@ app: # app global settings
catalog: catalog # service name for catalog api
ordering: ordering # service name for ordering api
orderingbackgroundtasks: orderingbackgroundtasks # service name for orderingbackgroundtasks
orderingsignalrhub: ordering-signalrhub # service name for orderingsignalrhub
orderingsignalrhub: ordering-signalrhub # service name for orderingsignalrhub
identity: identity # service name for identity api
mvc: webmvc # service name for web mvc
spa: webspa # service name for web spa

View File

@ -15,5 +15,5 @@ data:
urls__IdentityUrl: http://{{ $identity }}
basket__EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
all__InstrumentationKey: {{ .Values.inf.appinsights.key }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"

View File

@ -16,5 +16,5 @@ data:
catalog__PicBaseUrl: http://{{ $webshoppingapigw }}/api/v1/c/catalog/items/[0]/pic/
catalog__AzureStorageEnabled: "{{ .Values.inf.misc.useAzureStorage }}"
all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
all__InstrumentationKey: {{ .Values.inf.appinsights.key }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"

View File

@ -10,7 +10,8 @@ Param(
[parameter(Mandatory=$false)][string]$aksName="",
[parameter(Mandatory=$false)][string]$aksRg="",
[parameter(Mandatory=$false)][string]$imageTag="latest",
[parameter(Mandatory=$false)][bool]$useLocalk8s=$false
[parameter(Mandatory=$false)][bool]$useLocalk8s=$false,
[parameter(Mandatory=$false)][bool]$useLocalImages=$false
)
$dns = $externalDns
@ -22,6 +23,12 @@ if ($useLocalk8s -eq $true) {
$dns="localhost"
}
$pullPolicy = "Always"
if ($useLocalImages -eq $true) {
$pullPolicy = "IfNotPresent"
}
if ($externalDns -eq "aks") {
if ([string]::IsNullOrEmpty($aksName) -or [string]::IsNullOrEmpty($aksRg)) {
Write-Host "Error: When using -dns aks, MUST set -aksName and -aksRg too." -ForegroundColor Red
@ -45,7 +52,7 @@ if ([string]::IsNullOrEmpty($dns)) {
if ($clean) {
Write-Host "Cleaning previous helm releases..." -ForegroundColor Green
helm delete --purge $(helm ls -q)
helm delete --purge $(helm ls -q eshop)
Write-Host "Previous releases deleted" -ForegroundColor Green
}
@ -67,7 +74,7 @@ $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 --set ingress.hosts={$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 {
@ -78,11 +85,11 @@ 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
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
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=$pullPolicy --name="$appName-$chart" $chart
}
}
}
@ -91,4 +98,4 @@ else {
Write-Host "eShopOnContainers non-infrastructure charts aren't installed (-deployCharts is false)" -ForegroundColor Yellow
}
Write-Host "helm charts installed." -ForegroundColor Green
Write-Host "helm charts installed." -ForegroundColor Green

View File

@ -14,30 +14,32 @@ Parameters:
The resource group for the AKS cluster. Required when the registry (using the -r parameter) is set to "aks".
-b | --build-solution
Force a solution build before deployment (default: false).
-d | --dns <dns or ip address>
Specifies the external DNS/ IP address of the Kubernetes cluster.
-d | --dns <dns or ip address> | --dns aks
Specifies the external DNS/ IP address of the Kubernetes cluster.
If 'aks' is set as value, the DNS value is retrieved from the AKS. --aks-name and --aks-rg are needed.
When --use-local-k8s is specified the external DNS is automatically set to localhost.
-h | --help
Displays this help text and exits the script.
--image-build
Build images (default is to not build all images).
--image-push
Upload images to the container registry (default is not pushing to the custom registry)
-n | --app-name <the name of the app>
Specifies the name of the application (default: eshop).
--namespace <namespace name>
Specifies the namespace name to deploy the app. If it doesn't exists it will be created (default: eshop).
-p | --docker-password <docker password>
The Docker password used to logon to the custom registry, supplied using the -r parameter.
-r | --registry <container registry>
Specifies the container registry to use (required), e.g. myregistry.azurecr.io.
--skip-clean
Do not clean the Kubernetes cluster (default is to clean the cluster).
--skip-image-build
Do not build images (default is to build all images).
--skip-image-push
Do not upload images to the container registry (just run the Kubernetes deployment portion).
Default is to push the images to the container registry.
--skip-infrastructure
Do not deploy infrastructure resources (like sql-data, no-sql or redis).
This is useful for production environments where infrastructure is hosted outside the Kubernetes cluster.
-t | --tag <docker image tag>
The tag used for the newly created docker images. Default: newly created, date-based timestamp, with 1-minute resolution.
-u | --docker-user <docker username>
The tag used for the newly created docker images. Default: latest.
-u | --docker-username <docker username>
The Docker username used to logon to the custom registry, supplied using the -r parameter.
--use-local-k8s
Deploy to a locally installed Kubernetes (default: false).
@ -47,11 +49,10 @@ If using AKS and ACR see link for more info:
https://docs.microsoft.com/en-us/azure/container-registry/container-registry-auth-aks
WARNING! THE SCRIPT WILL COMPLETELY DESTROY ALL DEPLOYMENTS AND SERVICES VISIBLE
FROM THE CURRENT CONFIGURATION CONTEXT.
It is recommended that you create a separate namespace and confguration context
for the $app_name application, to isolate it from other applications on the cluster.
FROM THE CURRENT CONFIGURATION CONTEXT AND NAMESPACE.
It is recommended that you check your selected namespace, 'eshop' by default, is already in use.
Every deployment and service done in the namespace will be deleted.
For more information see https://kubernetes.io/docs/tasks/administer-cluster/namespaces/
You can use namespace.yaml file (in the same directory) to create the namespace.
END
}
@ -59,17 +60,18 @@ END
app_name='eshop'
aks_name=''
aks_rg=''
build_images='yes'
build_images=''
clean='yes'
build_solution=''
container_registry=''
docker_password=''
docker_username=''
dns=''
image_tag=$(date '+%Y%m%d%H%M')
push_images='yes'
image_tag='latest'
push_images=''
skip_infrastructure=''
use_local_k8s=''
namespace='eshop'
while [[ $# -gt 0 ]]; do
case "$1" in
@ -86,15 +88,15 @@ while [[ $# -gt 0 ]]; do
-n | --app-name )
app_name="$2"; shift 2;;
-p | --docker-password )
docker_password="$2"; shift;;
docker_password="$2"; shift 2;;
-r | --registry )
container_registry="$2"; shift 2;;
--skip-clean )
clean=''; shift ;;
--skip-image-build )
build_images=''; shift ;;
--skip-image-push )
push_images=''; shift ;;
--image-build )
build_images='yes'; shift ;;
--image-push )
push_images='yes'; shift ;;
--skip-infrastructure )
skip_infrastructure='yes'; shift ;;
-t | --tag )
@ -103,6 +105,8 @@ while [[ $# -gt 0 ]]; do
docker_username="$2"; shift 2;;
--use-local-k8s )
use_local_k8s='yes'; shift ;;
--namespace )
namespace="$2"; shift 2;;
*)
echo "Unknown option $1"
usage; exit 2 ;;
@ -124,10 +128,26 @@ if [[ $build_images ]]; then
docker rmi $(docker images -qf "dangling=true")
fi
use_custom_registry=''
if [[ -n $container_registry ]]; then
echo "################ Log into custom registry $container_registry ##################"
use_custom_registry='yes'
if [[ -z $docker_username ]] || [[ -z $docker_password ]]; then
echo "Error: Must use -u (--docker-username) AND -p (--docker-password) if specifying custom registry"
exit 1
fi
docker login -u $docker_username -p $docker_password $container_registry
fi
if [[ $push_images ]]; then
echo "#################### Pushing images to the container registry ####################"
services=(basket.api catalog.api identity.api ordering.api marketing.api payment.api locations.api webmvc webspa webstatus)
if [[ -z "$(docker image ls -q --filter=reference=eshop/$service:$image_tag)" ]]; then
image_tag=linux-$image_tag
fi
for service in "${services[@]}"
do
echo "Pushing image for service $service..."
@ -152,14 +172,23 @@ if [[ $dns == "aks" ]]; then
exit 1
fi
echo "Getting DNS of AKS of AKS $aks_name (in resource group $aks_rg)"
dns="$(az aks show -n $aks_name -g $aks_rg --query addonProfiles.httpApplicationRouting.config.HTTPApplicationRoutingZoneName)"
if [[ -z dns ]]; then
echo "Getting AKS cluster $aks_name AKS (in resource group $aks_rg)"
# JMESPath queries are case sensitive and httpapplicationrouting can be lowercase sometimes
jmespath_dnsqueries=(\
addonProfiles.httpApplicationRouting.config.HTTPApplicationRoutingZoneName \
addonProfiles.httpapplicationrouting.config.HTTPApplicationRoutingZoneName \
)
for q in "${jmespath_dnsqueries[@]}"
do
dns="$(az aks show -n $aks_name -g $aks_rg --query $q -o tsv)"
if [[ -n $dns ]]; then break; fi
done
if [[ -z $dns ]]; then
echo "Error: when getting DNS of AKS $aks_name (in resource group $aks_rg). Please ensure AKS has httpRouting enabled AND Azure CLI is logged in and is of version 2.0.37 or higher."
exit 1
fi
$dns=${dns//[\"]/""}
echo "DNS base found is $dns. Will use $aks_name.$dns for the app!"
dns="$aks_name.$dns"
fi
# Initialization & check commands
@ -169,17 +198,12 @@ fi
if [[ $clean ]]; then
echo "Cleaning previous helm releases..."
helm delete --purge $(helm ls -q)
echo "Previous releases deleted"
fi
use_custom_registry=''
if [[ -n $container_registry ]]; then
use_custom_registry='yes'
if [[ -z $docker_user ]] || [[ -z $docker_password ]]; then
echo "Error: Must use -u (--docker-username) AND -p (--docker-password) if specifying custom registry"
exit 1
if [[ -z $(helm ls -q --namespace $namespace) ]]; then
echo "No previous releases found"
else
helm delete --purge $(helm ls -q --namespace $namespace)
echo "Previous releases deleted"
waitsecs=10; while [ $waitsecs -gt 0 ]; do echo -ne "$waitsecs\033[0K\r"; sleep 1; : $((waitsecs--)); done
fi
fi
@ -191,7 +215,7 @@ if [[ !$skip_infrastructure ]]; then
for infra in "${infras[@]}"
do
echo "Installing infrastructure: $infra"
helm install --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --name="$app_name-$infra" $infra
helm install --namespace $namespace --set "ingress.hosts={$dns}" --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --name="$app_name-$infra" $infra
done
fi
@ -199,9 +223,9 @@ for chart in "${charts[@]}"
do
echo "Installing: $chart"
if [[ $use_custom_registry ]]; then
helm install --set inf.registry.server=$container_registry --set inf.registry.login=$docker_username --set inf.registry.pwd=$docker_password --set inf.registry.secretName=eshop-docker-scret --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --set image.tag=$image_tag --set image.pullPolicy=Always --name="$app_name-$chart" $chart
helm install --namespace $namespace --set "ingress.hosts={$dns}" --set inf.registry.server=$container_registry --set inf.registry.login=$docker_username --set inf.registry.pwd=$docker_password --set inf.registry.secretName=eshop-docker-scret --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --set image.tag=$image_tag --set image.pullPolicy=Always --name="$app_name-$chart" $chart
elif [[ $chart != "eshop-common" ]]; then # eshop-common is ignored when no secret must be deployed
helm install --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --set image.tag=$image_tag --set image.pullPolicy=Always --name="$app_name-$chart" $chart
helm install --namespace $namespace --set "ingress.hosts={$dns}" --values app.yaml --values inf.yaml --values $ingress_values_file --set app.name=$app_name --set inf.k8s.dns=$dns --set image.tag=$image_tag --set image.pullPolicy=Always --name="$app_name-$chart" $chart
fi
done

View File

@ -24,7 +24,7 @@ metadata:
data:
identity__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.identity.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }};
identity__keystore: {{ .Values.inf.redis.keystore.constr }}
all__InstrumentationKey: {{ .Values.inf.appinsights.key }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
mvc_e: http://{{ $mvc_url }}
spa_e: http://{{ $spa_url }}
locations_e: http://{{ $locations_url }}

View File

@ -1,4 +1,4 @@
# This heml values file defines all infrastructure used by eShopOnContainers.
# This helm values file defines all infrastructure used by eShopOnContainers.
# It is used on all charts, so ** MUST BE INCLUDED ** on every deployment
inf:
@ -15,11 +15,11 @@ inf:
identity:
db: IdentityDb # Ordering API SQL db name
marketing:
db: MarketingDb # Marketing API SQL db name
db: MarketingDb # Marketing API SQL db name
webhooks:
db: WebhooksDb # Webhooks DB
db: WebhooksDb # Webhooks DB
mongo:
# host: my-nosql-data # Uncomment to use specify custom mongo host. By default nosql-data is used
# host: my-nosql-data # Uncomment to use specify custom mongo host. By default nosql-data is used
locations:
database: LocationsDb
marketing:

View File

@ -13,7 +13,7 @@ metadata:
heritage: {{ .Release.Service }}
data:
all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
all__InstrumentationKey: {{ .Values.inf.appinsights.key }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"
all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
internalurls__IdentityUrl: http://{{ .Values.app.svc.identity }}

View File

@ -15,7 +15,7 @@ metadata:
heritage: {{ .Release.Service }}
data:
all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
all__InstrumentationKey: {{ .Values.inf.appinsights.key }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"
all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
internalurls__IdentityUrl: http://{{ .Values.app.svc.identity }}

View File

@ -10,7 +10,7 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
all__InstrumentationKey: {{ .Values.inf.appinsights.key }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
mobileshoppingagg__keystore: {{ .Values.inf.redis.keystore.constr }}
internalurls__basket: http://{{ .Values.app.svc.basket }}

View File

@ -16,5 +16,5 @@ data:
ordering__EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
urls__IdentityUrl: http://{{ $identity }}
all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
all__InstrumentationKey: {{ .Values.inf.appinsights.key }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"

View File

@ -15,7 +15,7 @@ data:
ordering__ConnectionString: Server={{ $sqlsrv }};Initial Catalog={{ .Values.inf.sql.ordering.db }};User Id={{ .Values.inf.sql.common.user }};Password={{ .Values.inf.sql.common.pwd }};
ordering__EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
all__InstrumentationKey: {{ .Values.inf.appinsights.key }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"
graceperiodmanager__CheckUpdateTime: "{{ .Values.cfg.checkUpdateTime }}"
graceperiodmanager__GracePeriodTime: "{{ .Values.cfg.gracePeriodTime }}"

View File

@ -12,7 +12,7 @@ metadata:
heritage: {{ .Release.Service }}
data:
all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
all__InstrumentationKey: {{ .Values.inf.appinsights.key }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"
signalr__StoreConnectionString: {{ .Values.inf.redis.keystore.constr }}
urls__IdentityUrl: http://{{ $identity }}

View File

@ -11,5 +11,5 @@ metadata:
heritage: {{ .Release.Service }}
data:
all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
all__InstrumentationKey: {{ .Values.inf.appinsights.key }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"

View File

@ -16,5 +16,5 @@ data:
urls__IdentityUrl: http://{{ $identity }}
urls__IdentityUrlExternal: http://{{ $identity }}
all__EventBusConnection: {{ .Values.inf.eventbus.constr }}
all__InstrumentationKey: {{ .Values.inf.appinsights.key }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"

View File

@ -14,7 +14,7 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
all__InstrumentationKey: {{ .Values.inf.appinsights.key }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"
all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
webmvc__keystore: {{ .Values.inf.redis.keystore.constr }}

View File

@ -10,7 +10,7 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
all__InstrumentationKey: {{ .Values.inf.appinsights.key }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
webshoppingagg__keystore: {{ .Values.inf.redis.keystore.constr }}
internalurls__basket: http://{{ .Values.app.svc.basket }}

View File

@ -16,7 +16,7 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
all__InstrumentationKey: {{ .Values.inf.appinsights.key }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
webspa__keystore: {{ .Values.inf.redis.keystore.constr }}
internalurls__apigwws: http://{{ .Values.app.svc.webshoppingapigw }}

View File

@ -15,7 +15,7 @@ metadata:
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
all__InstrumentationKey: {{ .Values.inf.appinsights.key }}
all__InstrumentationKey: "{{ .Values.inf.appinsights.key }}"
all__UseAzureServiceBus: "{{ .Values.inf.eventbus.useAzure }}"
all_EnableLoadTest: "{{ .Values.inf.misc.useLoadTest }}"
webstatus__keystore: {{ .Values.inf.redis.keystore.constr }}

View File

@ -34,73 +34,73 @@ env:
configmap:
- name: ApplicationInsights__InstrumentationKey
key: all__InstrumentationKey
- name: HealthChecks-UI__HealthChecks__0__Name
- name: HealthChecksUI__HealthChecks__0__Name
key: name__mvc__hc
- name: HealthChecks-UI__HealthChecks__0__Uri
- name: HealthChecksUI__HealthChecks__0__Uri
key: internalurls__mvc__hc
- name: HealthChecks-UI__HealthChecks__1__Name
- name: HealthChecksUI__HealthChecks__1__Name
key: name__spa__hc
- name: HealthChecks-UI__HealthChecks__1__Uri
- name: HealthChecksUI__HealthChecks__1__Uri
key: internalurls__spa__hc
- name: HealthChecks-UI__HealthChecks__2__Name
- name: HealthChecksUI__HealthChecks__2__Name
key: name__apigwws__hc
- name: HealthChecks-UI__HealthChecks__2__Uri
- name: HealthChecksUI__HealthChecks__2__Uri
key: internalurls__apigwws__hc
- name: HealthChecks-UI__HealthChecks__3__Name
- name: HealthChecksUI__HealthChecks__3__Name
key: name__apigwwm__hc
- name: HealthChecks-UI__HealthChecks__3__Uri
- name: HealthChecksUI__HealthChecks__3__Uri
key: internalurls__apigwwm__hc
- name: HealthChecks-UI__HealthChecks__4__Name
- name: HealthChecksUI__HealthChecks__4__Name
key: name__apigwms__hc
- name: HealthChecks-UI__HealthChecks__4__Uri
- name: HealthChecksUI__HealthChecks__4__Uri
key: internalurls__apigwms__hc
- name: HealthChecks-UI__HealthChecks__5__Name
- name: HealthChecksUI__HealthChecks__5__Name
key: name__apigwmm__hc
- name: HealthChecks-UI__HealthChecks__5__Uri
- name: HealthChecksUI__HealthChecks__5__Uri
key: internalurls__apigwmm__hc
- name: HealthChecks-UI__HealthChecks__6__Name
- name: HealthChecksUI__HealthChecks__6__Name
key: name__apigwwsagg__hc
- name: HealthChecks-UI__HealthChecks__6__Uri
- name: HealthChecksUI__HealthChecks__6__Uri
key: internalurls__apigwwsagg__hc
- name: HealthChecks-UI__HealthChecks__7__Name
- name: HealthChecksUI__HealthChecks__7__Name
key: name__apigwmsagg__hc
- name: HealthChecks-UI__HealthChecks__7__Uri
- name: HealthChecksUI__HealthChecks__7__Uri
key: internalurls__apigwmsagg__hc
- name: HealthChecks-UI__HealthChecks__8__Name
- name: HealthChecksUI__HealthChecks__8__Name
key: name__ordering__hc
- name: HealthChecks-UI__HealthChecks__8__Uri
- name: HealthChecksUI__HealthChecks__8__Uri
key: internalurls__ordering__hc
- name: HealthChecks-UI__HealthChecks__9__Name
- name: HealthChecksUI__HealthChecks__9__Name
key: name__orderingbackground__hc
- name: HealthChecks-UI__HealthChecks__9__Uri
- name: HealthChecksUI__HealthChecks__9__Uri
key: internalurls__orderingbackground__hc
- name: HealthChecks-UI__HealthChecks__10__Name
- name: HealthChecksUI__HealthChecks__10__Name
key: name__signalrhub__hc
- name: HealthChecks-UI__HealthChecks__10__Uri
- name: HealthChecksUI__HealthChecks__10__Uri
key: internalurls__signalrhub__hc
- name: HealthChecks-UI__HealthChecks__11__Name
- name: HealthChecksUI__HealthChecks__11__Name
key: name__basket__hc
- name: HealthChecks-UI__HealthChecks__11__Uri
- name: HealthChecksUI__HealthChecks__11__Uri
key: internalurls__basket__hc
- name: HealthChecks-UI__HealthChecks__12__Name
- name: HealthChecksUI__HealthChecks__12__Name
key: name__catalog__hc
- name: HealthChecks-UI__HealthChecks__12__Uri
- name: HealthChecksUI__HealthChecks__12__Uri
key: internalurls__catalog__hc
- name: HealthChecks-UI__HealthChecks__13__Name
- name: HealthChecksUI__HealthChecks__13__Name
key: name__identity__hc
- name: HealthChecks-UI__HealthChecks__13__Uri
- name: HealthChecksUI__HealthChecks__13__Uri
key: internalurls__identity__hc
- name: HealthChecks-UI__HealthChecks__14__Name
- name: HealthChecksUI__HealthChecks__14__Name
key: name__marketing__hc
- name: HealthChecks-UI__HealthChecks__14__Uri
- name: HealthChecksUI__HealthChecks__14__Uri
key: internalurls__marketing__hc
- name: HealthChecks-UI__HealthChecks__15__Name
- name: HealthChecksUI__HealthChecks__15__Name
key: name__locations__hc
- name: HealthChecks-UI__HealthChecks__15__Uri
- name: HealthChecksUI__HealthChecks__15__Uri
key: internalurls__locations__hc
- name: HealthChecks-UI__HealthChecks__16__Name
- name: HealthChecksUI__HealthChecks__16__Name
key: name__payment__hc
- name: HealthChecks-UI__HealthChecks__16__Uri
- name: HealthChecksUI__HealthChecks__16__Uri
key: internalurls__payment__hc
# values define environment variables with a fixed value (no configmap involved) (name is name of var, and value is its value)
values:

View File

@ -0,0 +1,12 @@
kind: Service
apiVersion: v1
metadata:
name: rabbitmq-admin
spec:
type: NodePort
selector:
app: rabbitmq
ports:
- port: 15672
nodePort: 31672
name: rabbitmq-port

View File

@ -0,0 +1,12 @@
kind: Service
apiVersion: v1
metadata:
name: sql-service
spec:
type: NodePort
selector:
app: sql-data
ports:
- port: 1433
nodePort: 31433
name: sql-port

View File

@ -7,7 +7,7 @@ This file contains links to the documentation of the project.
## Documentation included in files
* [Branch Guide](../branch-guide.md): List of branches used and their purpose.
* [vsts-docs folder](../vsts-docs/readme.md): Information about how to setup a CI/CD procedure using VSTS
* [vsts-docs folder](../vsts-docs/readme.md): Information about how to setup a CI/CD procedure using Azure DevOps
* [Kubernetes](../k8s/readme.md): Information about how to deploy eShopOnContainers in a kubernetes cluster, and how to setup a CI/CD for k8s using VSTS
* [deploy](../deploy/readme.md): Information about how deploy Azure resources using the Azure CLI 2.0.
* [.env file](./README.ENV.md): What is the `.env` file and how to use it to configure eShopOnContainers to use external resources (like Azure)

View File

@ -1,3 +1 @@
#!/bin/bash
for f in /src/csproj-files/*.csproj; do dotnet restore $f; done
echo RESTORING ALL PACKAGES...; for f in /src/csproj-files/*.csproj; do dotnet restore $f; done

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