commit
						7d6c8f8f92
					
				
							
								
								
									
										24
									
								
								.dockerignore
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								.dockerignore
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,24 @@ | |||||||
|  | .dockerignore | ||||||
|  | .env | ||||||
|  | .git | ||||||
|  | .gitignore | ||||||
|  | .vs | ||||||
|  | .vscode | ||||||
|  | docker-compose.yml | ||||||
|  | docker-compose.*.yml | ||||||
|  | vsts-docs | ||||||
|  | test | ||||||
|  | ServiceFabric | ||||||
|  | readme | ||||||
|  | k8s | ||||||
|  | img | ||||||
|  | docs | ||||||
|  | deploy | ||||||
|  | Components | ||||||
|  | cli-windows | ||||||
|  | cli-mac | ||||||
|  | cli-linux | ||||||
|  | **/bin/ | ||||||
|  | **/obj/ | ||||||
|  | **/node_modules/ | ||||||
|  | **/bower_components/ | ||||||
| @ -1,5 +1,8 @@ | |||||||
| <?xml version="1.0" encoding="utf-8"?> | <?xml version="1.0" encoding="utf-8"?> | ||||||
| <configuration> | <configuration> | ||||||
|  |   <config> | ||||||
|  |     <add key="repositoryPath" value="packages" /> | ||||||
|  |   </config> | ||||||
|   <packageSources> |   <packageSources> | ||||||
|     <add key="AspNetCore" value="https://dotnet.myget.org/F/aspnet-feb2017-patch/api/v3/index.json" /> |     <add key="AspNetCore" value="https://dotnet.myget.org/F/aspnet-feb2017-patch/api/v3/index.json" /> | ||||||
|     <add key="NuGet" value="https://api.nuget.org/v3/index.json" /> |     <add key="NuGet" value="https://api.nuget.org/v3/index.json" /> | ||||||
|  | |||||||
| @ -1,9 +1,14 @@ | |||||||
| version: '2' | version: '3' | ||||||
| 
 | 
 | ||||||
| services: | services: | ||||||
|   sql.data: |   sql.data: | ||||||
|     environment: |     environment: | ||||||
|       - MSSQL_SA_PASSWORD=Pass@word |       - MSSQL_SA_PASSWORD=Pass@word | ||||||
|       - ACCEPT_EULA=Y |       - ACCEPT_EULA=Y | ||||||
|  |       - MSSQL_PID=Developer | ||||||
|     ports: |     ports: | ||||||
|       - "5433:1433" |       - "5433:1433" | ||||||
|  |    | ||||||
|  |   nosql.data: | ||||||
|  |     ports: | ||||||
|  |       - "27017:27017" | ||||||
| @ -13,3 +13,6 @@ services: | |||||||
|     image: rabbitmq |     image: rabbitmq | ||||||
|     ports: |     ports: | ||||||
|       - "5672:5672" |       - "5672:5672" | ||||||
|  |    | ||||||
|  |   nosql.data: | ||||||
|  |     image: mongo | ||||||
|  | |||||||
| @ -9,6 +9,7 @@ | |||||||
|     <ProjectVersion>2.0</ProjectVersion> |     <ProjectVersion>2.0</ProjectVersion> | ||||||
|   </PropertyGroup> |   </PropertyGroup> | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|  |     <None Include=".dockerignore" /> | ||||||
|     <None Include="docker-compose.ci.build.yml" /> |     <None Include="docker-compose.ci.build.yml" /> | ||||||
|     <None Include="docker-compose.override.yml"> |     <None Include="docker-compose.override.yml"> | ||||||
|       <DependentUpon>docker-compose.yml</DependentUpon> |       <DependentUpon>docker-compose.yml</DependentUpon> | ||||||
|  | |||||||
| @ -5,8 +5,8 @@ services: | |||||||
|   basket.api: |   basket.api: | ||||||
|     image: eshop/basket.api:${TAG:-latest} |     image: eshop/basket.api:${TAG:-latest} | ||||||
|     build: |     build: | ||||||
|       context: ./src/Services/Basket/Basket.API |       context: . | ||||||
|       dockerfile: Dockerfile     |       dockerfile: ./src/Services/Basket/Basket.API/Dockerfile     | ||||||
|     depends_on: |     depends_on: | ||||||
|       - basket.data |       - basket.data | ||||||
|       - identity.api |       - identity.api | ||||||
| @ -15,8 +15,8 @@ services: | |||||||
|   catalog.api: |   catalog.api: | ||||||
|     image: eshop/catalog.api:${TAG:-latest} |     image: eshop/catalog.api:${TAG:-latest} | ||||||
|     build: |     build: | ||||||
|       context: ./src/Services/Catalog/Catalog.API |       context: . | ||||||
|       dockerfile: Dockerfile     |       dockerfile: ./src/Services/Catalog/Catalog.API/Dockerfile | ||||||
|     depends_on: |     depends_on: | ||||||
|       - sql.data |       - sql.data | ||||||
|       - rabbitmq |       - rabbitmq | ||||||
| @ -24,16 +24,16 @@ services: | |||||||
|   identity.api: |   identity.api: | ||||||
|     image: eshop/identity.api:${TAG:-latest} |     image: eshop/identity.api:${TAG:-latest} | ||||||
|     build: |     build: | ||||||
|       context: ./src/Services/Identity/Identity.API |       context: . | ||||||
|       dockerfile: Dockerfile     |       dockerfile: ./src/Services/Identity/Identity.API/Dockerfile     | ||||||
|     depends_on: |     depends_on: | ||||||
|       - sql.data |       - sql.data | ||||||
| 
 | 
 | ||||||
|   ordering.api: |   ordering.api: | ||||||
|     image: eshop/ordering.api:${TAG:-latest} |     image: eshop/ordering.api:${TAG:-latest} | ||||||
|     build: |     build: | ||||||
|       context: ./src/Services/Ordering/Ordering.API |       context: . | ||||||
|       dockerfile: Dockerfile     |       dockerfile: ./src/Services/Ordering/Ordering.API/Dockerfile     | ||||||
|     depends_on: |     depends_on: | ||||||
|       - sql.data |       - sql.data | ||||||
|       - rabbitmq |       - rabbitmq | ||||||
| @ -41,8 +41,8 @@ services: | |||||||
|   marketing.api: |   marketing.api: | ||||||
|     image: eshop/marketing.api:${TAG:-latest} |     image: eshop/marketing.api:${TAG:-latest} | ||||||
|     build: |     build: | ||||||
|       context: ./src/Services/Marketing/Marketing.API |       context: . | ||||||
|       dockerfile: Dockerfile     |       dockerfile: ./src/Services/Marketing/Marketing.API/Dockerfile     | ||||||
|     depends_on: |     depends_on: | ||||||
|       - sql.data |       - sql.data | ||||||
|       - nosql.data |       - nosql.data | ||||||
| @ -52,8 +52,8 @@ services: | |||||||
|   webspa: |   webspa: | ||||||
|     image: eshop/webspa:${TAG:-latest} |     image: eshop/webspa:${TAG:-latest} | ||||||
|     build: |     build: | ||||||
|       context: ./src/Web/WebSPA |       context: . | ||||||
|       dockerfile: Dockerfile     |       dockerfile: ./src/Web/WebSPA/Dockerfile     | ||||||
|     depends_on: |     depends_on: | ||||||
|       - catalog.api |       - catalog.api | ||||||
|       - ordering.api |       - ordering.api | ||||||
| @ -64,8 +64,8 @@ services: | |||||||
|   webmvc: |   webmvc: | ||||||
|     image: eshop/webmvc:${TAG:-latest} |     image: eshop/webmvc:${TAG:-latest} | ||||||
|     build: |     build: | ||||||
|       context: ./src/Web/WebMVC |       context: . | ||||||
|       dockerfile: Dockerfile     |       dockerfile: ./src/Web/WebMVC/Dockerfile     | ||||||
|     depends_on: |     depends_on: | ||||||
|       - catalog.api |       - catalog.api | ||||||
|       - ordering.api |       - ordering.api | ||||||
| @ -76,22 +76,22 @@ services: | |||||||
|   webstatus: |   webstatus: | ||||||
|     image: eshop/webstatus:${TAG:-latest} |     image: eshop/webstatus:${TAG:-latest} | ||||||
|     build: |     build: | ||||||
|       context: ./src/Web/WebStatus |       context: . | ||||||
|       dockerfile: Dockerfile |       dockerfile: ./src/Web/WebStatus/Dockerfile | ||||||
| 
 | 
 | ||||||
|   payment.api: |   payment.api: | ||||||
|     image: eshop/payment.api:${TAG:-latest} |     image: eshop/payment.api:${TAG:-latest} | ||||||
|     build: |     build: | ||||||
|       context: ./src/Services/Payment/Payment.API |       context: . | ||||||
|       dockerfile: Dockerfile |       dockerfile: ./src/Services/Payment/Payment.API/Dockerfile | ||||||
|     depends_on: |     depends_on: | ||||||
|       - rabbitmq     |       - rabbitmq     | ||||||
|      |      | ||||||
|   locations.api: |   locations.api: | ||||||
|     image: eshop/locations.api:${TAG:-latest} |     image: eshop/locations.api:${TAG:-latest} | ||||||
|     build: |     build: | ||||||
|       context: ./src/Services/Location/Locations.API |       context: . | ||||||
|       dockerfile: Dockerfile |       dockerfile: ./src/Services/Location/Locations.API/Dockerfile | ||||||
|     depends_on: |     depends_on: | ||||||
|       - nosql.data |       - nosql.data | ||||||
|       - rabbitmq |       - rabbitmq | ||||||
|  | |||||||
										
											Binary file not shown.
										
									
								
							| @ -4,11 +4,15 @@ For k8s CI/CD pipeline delivery a series of tasks must be created in VSTS to dep | |||||||
| ## Prerequisites | ## Prerequisites | ||||||
| * A Kubernetes cluster. Follow Azure Container Service's [walkthrough](https://docs.microsoft.com/en-us/azure/container-service/container-service-kubernetes-walkthrough) to create one.  | * A Kubernetes cluster. Follow Azure Container Service's [walkthrough](https://docs.microsoft.com/en-us/azure/container-service/container-service-kubernetes-walkthrough) to create one.  | ||||||
| * A private Docker registry. Follow Azure Container Registry's [guide](https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal) to create one. | * A private Docker registry. Follow Azure Container Registry's [guide](https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal) to create one. | ||||||
| * Optionally, previous steps can be skipped if you run gen-k8s-env.ps1 script to automatically create the azure environment needed for kubernetes deployment. Azure cli 2.0 must be previously installed [installation guide](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli). For example: | * Optionally, previous steps can be skipped if you run gen-k8s-env.ps1 (or gen-k8s-env-aks.ps1 if you would like to use AKS instead of ACS) script to automatically create the azure environment needed for kubernetes deployment. Azure cli 2.0 must be previously installed [installation guide](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli). For example: | ||||||
| 
 | 
 | ||||||
| >``` | >``` | ||||||
| >./gen-k8s-env -resourceGroupName k8sGroup -location westeurope -registryName k8sregistry -orchestratorName k8s-cluster -dnsName k8s-dns | >./gen-k8s-env -resourceGroupName k8sGroup -location westeurope -registryName k8sregistry -orchestratorName k8s-cluster -dnsName k8s-dns | ||||||
| >``` | >``` | ||||||
|  | or using AKS instead of ACS | ||||||
|  | >``` | ||||||
|  | >./gen-k8s-env-aks -resourceGroupName k8sGroup -location westeurope -registryName k8sregistry -dnsName k8s-dns -serviceName k8s-cluster -createAcr true -nodeCount 3 -nodeVMSize Standard_D2_v2 | ||||||
|  | >``` | ||||||
| * An `Azure Blob storage`. It is needed for storing the kubernetes config file used by the hosted agent to access to Kubernetes cluster. Example: | * An `Azure Blob storage`. It is needed for storing the kubernetes config file used by the hosted agent to access to Kubernetes cluster. Example: | ||||||
| 
 | 
 | ||||||
| <img src="./img/k8s/blob_creation.png"> | <img src="./img/k8s/blob_creation.png"> | ||||||
| @ -23,7 +27,7 @@ For k8s CI/CD pipeline delivery a series of tasks must be created in VSTS to dep | |||||||
| 1. Create a `Download File` task to download the kubernetes binary `kubectl` to the hosted agent. For example: | 1. Create a `Download File` task to download the kubernetes binary `kubectl` to the hosted agent. For example: | ||||||
| 
 | 
 | ||||||
| >``` | >``` | ||||||
| >https://storage.googleapis.com/kubernetes-release/release/v0.0.1.7.0-alpha.0/bin/windows/386/kubectl.exe | >https://storage.googleapis.com/kubernetes-release/release/v1.8.5/bin/windows/386/kubectl.exe | ||||||
| >``` | >``` | ||||||
| 
 | 
 | ||||||
| <img src="./img/get_kubectlbin_task.png"> | <img src="./img/get_kubectlbin_task.png"> | ||||||
|  | |||||||
| @ -4,13 +4,17 @@ The k8s directory contains Kubernetes configuration for the eShopOnContainers ap | |||||||
| ## Prerequisites | ## Prerequisites | ||||||
| * A Kubernetes cluster. Follow Azure Container Service's [walkthrough](https://docs.microsoft.com/en-us/azure/container-service/container-service-kubernetes-walkthrough) to create one.  | * A Kubernetes cluster. Follow Azure Container Service's [walkthrough](https://docs.microsoft.com/en-us/azure/container-service/container-service-kubernetes-walkthrough) to create one.  | ||||||
| * A private Docker registry. Follow Azure Container Registry's [guide](https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal) to create one. | * A private Docker registry. Follow Azure Container Registry's [guide](https://docs.microsoft.com/en-us/azure/container-registry/container-registry-get-started-portal) to create one. | ||||||
| * Optionally, previous steps can be skipped if you run gen-k8s-env.ps1 script to automatically create the azure environment needed for kubernetes deployment. Azure cli 2.0 must be previously installed [installation guide](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli). For example: | * Optionally, previous steps can be skipped if you run gen-k8s-env.ps1 (or gen-k8s-env-aks.ps1 if you would like to use AKS instead of ACS) script to automatically create the azure environment needed for kubernetes deployment. Azure cli 2.0 must be previously installed [installation guide](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli). For example: | ||||||
| 
 | 
 | ||||||
|     **Important**: Note the parameter "-createAcr true". If you are creating the K8s cluster but you want to re-use and existing ACR, say "-createAcr false". |     **Important**: Note the parameter "-createAcr true". If you are creating the K8s cluster but you want to re-use and existing ACR, say "-createAcr false". | ||||||
| 
 | 
 | ||||||
| >``` | >``` | ||||||
| >./gen-k8s-env -resourceGroupName k8sGroup -location westeurope -registryName k8sregistry -createAcr true -orchestratorName k8s-cluster -dnsName k8s-dns | >./gen-k8s-env -resourceGroupName k8sGroup -location westeurope -registryName k8sregistry -createAcr true -orchestratorName k8s-cluster -dnsName k8s-dns | ||||||
| >``` | >``` | ||||||
|  | or using AKS instead of ACS | ||||||
|  | >``` | ||||||
|  | >./gen-k8s-env-aks -resourceGroupName k8sGroup -location westeurope -registryName k8sregistry -dnsName k8s-dns -serviceName k8s-cluster -createAcr true -nodeCount 3 -nodeVMSize Standard_D2_v2 | ||||||
|  | >``` | ||||||
| 
 | 
 | ||||||
| * A Docker development environment with `docker` and `docker-compose`. | * A Docker development environment with `docker` and `docker-compose`. | ||||||
|     * Visit [docker.com](https://docker.com) to download the tools and set up the environment. Docker's [installation guide](https://docs.docker.com/engine/getstarted/step_one/#step-3-verify-your-installation) covers verifying your Docker installation. |     * Visit [docker.com](https://docker.com) to download the tools and set up the environment. Docker's [installation guide](https://docs.docker.com/engine/getstarted/step_one/#step-3-verify-your-installation) covers verifying your Docker installation. | ||||||
|  | |||||||
| @ -104,7 +104,7 @@ ExecKube -cmd 'delete configmap config-files' | |||||||
| ExecKube -cmd 'delete configmap urls' | ExecKube -cmd 'delete configmap urls' | ||||||
| ExecKube -cmd 'delete configmap externalcfg' | ExecKube -cmd 'delete configmap externalcfg' | ||||||
| 
 | 
 | ||||||
| # start sql, rabbitmq, frontend deploymentsExecKube -cmd 'delete configmap config-files' | # start sql, rabbitmq, frontend deployments | ||||||
| ExecKube -cmd 'create configmap config-files --from-file=nginx-conf=nginx.conf' | ExecKube -cmd 'create configmap config-files --from-file=nginx-conf=nginx.conf' | ||||||
| ExecKube -cmd 'label configmap config-files app=eshop' | ExecKube -cmd 'label configmap config-files app=eshop' | ||||||
| 
 | 
 | ||||||
|  | |||||||
							
								
								
									
										32
									
								
								k8s/gen-k8s-env-aks.ps1
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										32
									
								
								k8s/gen-k8s-env-aks.ps1
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,32 @@ | |||||||
|  | Param( | ||||||
|  |     [parameter(Mandatory=$true)][string]$resourceGroupName, | ||||||
|  |     [parameter(Mandatory=$true)][string]$location, | ||||||
|  |     [parameter(Mandatory=$false)][string]$registryName, | ||||||
|  |     [parameter(Mandatory=$true)][string]$serviceName, | ||||||
|  |     [parameter(Mandatory=$true)][string]$dnsName, | ||||||
|  |     [parameter(Mandatory=$true)][string]$createAcr=$true, | ||||||
|  |     [parameter(Mandatory=$false)][int]$nodeCount=2, | ||||||
|  |     [parameter(Mandatory=$false)][string]$nodeVMSize="Standard_D2_v2" | ||||||
|  | ) | ||||||
|  | 
 | ||||||
|  | # Create resource group | ||||||
|  | Write-Host "Creating resource group..." -ForegroundColor Yellow | ||||||
|  | az group create --name=$resourceGroupName --location=$location | ||||||
|  | 
 | ||||||
|  | if ($createAcr -eq $true) { | ||||||
|  |     # Create Azure Container Registry | ||||||
|  |     Write-Host "Creating Azure Container Registry..." -ForegroundColor Yellow | ||||||
|  |     az acr create -n $registryName -g $resourceGroupName -l $location  --admin-enabled true --sku Basic | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | # Create kubernetes orchestrator | ||||||
|  | Write-Host "Creating kubernetes orchestrator..." -ForegroundColor Yellow | ||||||
|  | az aks create --resource-group=$resourceGroupName --name=$serviceName --dns-name-prefix=$dnsName --generate-ssh-keys --node-count=$nodeCount --node-vm-size=$nodeVMSize | ||||||
|  | 
 | ||||||
|  | # Retrieve kubernetes cluster configuration and save it under ~/.kube/config  | ||||||
|  | az aks get-credentials --resource-group=$resourceGroupName --name=$serviceName | ||||||
|  | 
 | ||||||
|  | if ($createAcr -eq $true) { | ||||||
|  |     # Show ACR credentials | ||||||
|  |     az acr credential show -n $registryName | ||||||
|  | } | ||||||
| @ -1,3 +0,0 @@ | |||||||
| * |  | ||||||
| !obj/Docker/publish/* |  | ||||||
| !obj/Docker/empty/ |  | ||||||
| @ -10,9 +10,6 @@ | |||||||
|     <Content Update="web.config"> |     <Content Update="web.config"> | ||||||
|       <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> |       <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> | ||||||
|     </Content> |     </Content> | ||||||
|     <Content Include=".dockerignore"> |  | ||||||
|       <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> |  | ||||||
|     </Content> |  | ||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
| 
 | 
 | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
| @ -33,10 +30,4 @@ | |||||||
|     <ProjectReference Include="..\..\..\BuildingBlocks\HealthChecks\src\Microsoft.Extensions.HealthChecks\Microsoft.Extensions.HealthChecks.csproj" /> |     <ProjectReference Include="..\..\..\BuildingBlocks\HealthChecks\src\Microsoft.Extensions.HealthChecks\Microsoft.Extensions.HealthChecks.csproj" /> | ||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
| 
 | 
 | ||||||
|   <ItemGroup> |  | ||||||
|     <None Update="Dockerfile"> |  | ||||||
|       <CopyToOutputDirectory>Always</CopyToOutputDirectory> |  | ||||||
|     </None> |  | ||||||
|   </ItemGroup> |  | ||||||
| 
 |  | ||||||
| </Project> | </Project> | ||||||
|  | |||||||
| @ -1,6 +1,25 @@ | |||||||
| FROM microsoft/aspnetcore:2.0 | FROM microsoft/aspnetcore:2.0 AS base | ||||||
| ARG source |  | ||||||
| WORKDIR /app | WORKDIR /app | ||||||
| EXPOSE 80 | EXPOSE 80 | ||||||
| COPY ${source:-obj/Docker/publish} . | 
 | ||||||
|  | FROM microsoft/aspnetcore-build:2.0 AS build | ||||||
|  | WORKDIR /src | ||||||
|  | COPY eShopOnContainers-ServicesAndWebApps.sln ./ | ||||||
|  | COPY src/Services/Basket/Basket.API/Basket.API.csproj src/Services/Basket/Basket.API/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/ | ||||||
|  | COPY src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj src/BuildingBlocks/EventBus/EventBusRabbitMQ/ | ||||||
|  | COPY src/BuildingBlocks/EventBus/EventBus/EventBus.csproj src/BuildingBlocks/EventBus/EventBus/ | ||||||
|  | COPY src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj src/BuildingBlocks/EventBus/EventBusServiceBus/ | ||||||
|  | RUN dotnet restore | ||||||
|  | COPY . . | ||||||
|  | WORKDIR /src/src/Services/Basket/Basket.API | ||||||
|  | RUN dotnet build -c Release -o /app | ||||||
|  | 
 | ||||||
|  | FROM build AS publish | ||||||
|  | RUN dotnet publish -c Release -o /app | ||||||
|  | 
 | ||||||
|  | FROM base AS final | ||||||
|  | WORKDIR /app | ||||||
|  | COPY --from=publish /app . | ||||||
| ENTRYPOINT ["dotnet", "Basket.API.dll"] | ENTRYPOINT ["dotnet", "Basket.API.dll"] | ||||||
|  | |||||||
| @ -1,3 +0,0 @@ | |||||||
| * |  | ||||||
| !obj/Docker/publish/* |  | ||||||
| !obj/Docker/empty/ |  | ||||||
| @ -61,9 +61,6 @@ | |||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
| 
 | 
 | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|     <None Update="Dockerfile"> |  | ||||||
|       <CopyToOutputDirectory>Always</CopyToOutputDirectory> |  | ||||||
|     </None> |  | ||||||
|     <None Update="Pics\*"> |     <None Update="Pics\*"> | ||||||
|       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||||
|     </None> |     </None> | ||||||
|  | |||||||
| @ -1,6 +1,29 @@ | |||||||
| FROM microsoft/aspnetcore:2.0 | FROM microsoft/aspnetcore:2.0 AS base | ||||||
| ARG source |  | ||||||
| WORKDIR /app | WORKDIR /app | ||||||
| EXPOSE 80 | EXPOSE 80 | ||||||
| COPY ${source:-obj/Docker/publish} . | 
 | ||||||
|  | FROM microsoft/aspnetcore-build:2.0 AS build | ||||||
|  | WORKDIR /src | ||||||
|  | COPY eShopOnContainers-ServicesAndWebApps.sln ./ | ||||||
|  | COPY src/Services/Catalog/Catalog.API/Catalog.API.csproj src/Services/Catalog/Catalog.API/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/ | ||||||
|  | COPY src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj src/BuildingBlocks/EventBus/IntegrationEventLogEF/ | ||||||
|  | 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/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/Microsoft.Extensions.HealthChecks.SqlServer.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.AzureStorage/Microsoft.Extensions.HealthChecks.AzureStorage.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.AzureStorage/ | ||||||
|  | RUN dotnet restore | ||||||
|  | COPY . . | ||||||
|  | WORKDIR /src/src/Services/Catalog/Catalog.API | ||||||
|  | RUN dotnet build -c Release -o /app | ||||||
|  | 
 | ||||||
|  | FROM build AS publish | ||||||
|  | RUN dotnet publish -c Release -o /app | ||||||
|  | 
 | ||||||
|  | FROM base AS final | ||||||
|  | WORKDIR /app | ||||||
|  | COPY --from=publish /app . | ||||||
| ENTRYPOINT ["dotnet", "Catalog.API.dll"] | ENTRYPOINT ["dotnet", "Catalog.API.dll"] | ||||||
|  | |||||||
| @ -1,3 +0,0 @@ | |||||||
| * |  | ||||||
| !obj/Docker/publish/* |  | ||||||
| !obj/Docker/empty/ |  | ||||||
| @ -1,6 +1,25 @@ | |||||||
| FROM microsoft/aspnetcore:2.0.0 | FROM microsoft/aspnetcore:2.0 AS base | ||||||
| ARG source |  | ||||||
| WORKDIR /app | WORKDIR /app | ||||||
| EXPOSE 80 | EXPOSE 80 | ||||||
| COPY ${source:-obj/Docker/publish} . | 
 | ||||||
|  | FROM microsoft/aspnetcore-build:2.0 AS build | ||||||
|  | WORKDIR /src | ||||||
|  | COPY eShopOnContainers-ServicesAndWebApps.sln ./ | ||||||
|  | COPY src/Services/Identity/Identity.API/Identity.API.csproj src/Services/Identity/Identity.API/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/ | ||||||
|  | COPY src/BuildingBlocks/DataProtection/DataProtection/DataProtection.csproj src/BuildingBlocks/DataProtection/DataProtection/ | ||||||
|  | COPY src/BuildingBlocks/WebHostCustomization/WebHost.Customization/WebHost.Customization.csproj src/BuildingBlocks/WebHostCustomization/WebHost.Customization/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/Microsoft.Extensions.HealthChecks.SqlServer.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/ | ||||||
|  | RUN dotnet restore | ||||||
|  | COPY . . | ||||||
|  | WORKDIR /src/src/Services/Identity/Identity.API | ||||||
|  | RUN dotnet build -c Release -o /app | ||||||
|  | 
 | ||||||
|  | FROM build AS publish | ||||||
|  | RUN dotnet publish -c Release -o /app | ||||||
|  | 
 | ||||||
|  | FROM base AS final | ||||||
|  | WORKDIR /app | ||||||
|  | COPY --from=publish /app . | ||||||
| ENTRYPOINT ["dotnet", "Identity.API.dll"] | ENTRYPOINT ["dotnet", "Identity.API.dll"] | ||||||
|  | |||||||
| @ -51,9 +51,6 @@ | |||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
| 
 | 
 | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|     <None Update="Dockerfile"> |  | ||||||
|       <CopyToOutputDirectory>Always</CopyToOutputDirectory> |  | ||||||
|     </None> |  | ||||||
|     <None Update="Setup\*"> |     <None Update="Setup\*"> | ||||||
|       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||||
|     </None> |     </None> | ||||||
|  | |||||||
| @ -148,8 +148,6 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API | |||||||
|                 await next(); |                 await next(); | ||||||
|             }); |             }); | ||||||
| 
 | 
 | ||||||
|             app.UseAuthentication(); |  | ||||||
| 
 |  | ||||||
|             // Adds IdentityServer |             // Adds IdentityServer | ||||||
|             app.UseIdentityServer(); |             app.UseIdentityServer(); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,3 +0,0 @@ | |||||||
| * |  | ||||||
| !obj/Docker/publish/* |  | ||||||
| !obj/Docker/empty/ |  | ||||||
| @ -1,6 +1,25 @@ | |||||||
| FROM microsoft/aspnetcore:2.0 | FROM microsoft/aspnetcore:2.0 AS base | ||||||
| ARG source |  | ||||||
| WORKDIR /app | WORKDIR /app | ||||||
| EXPOSE 80 | EXPOSE 80 | ||||||
| COPY ${source:-obj/Docker/publish} . | 
 | ||||||
|  | FROM microsoft/aspnetcore-build:2.0 AS build | ||||||
|  | WORKDIR /src | ||||||
|  | COPY eShopOnContainers-ServicesAndWebApps.sln ./ | ||||||
|  | COPY src/Services/Location/Locations.API/Locations.API.csproj src/Services/Location/Locations.API/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/ | ||||||
|  | COPY src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj src/BuildingBlocks/EventBus/EventBusRabbitMQ/ | ||||||
|  | COPY src/BuildingBlocks/EventBus/EventBus/EventBus.csproj src/BuildingBlocks/EventBus/EventBus/ | ||||||
|  | COPY src/BuildingBlocks/EventBus/EventBusServiceBus/EventBusServiceBus.csproj src/BuildingBlocks/EventBus/EventBusServiceBus/ | ||||||
|  | RUN dotnet restore | ||||||
|  | COPY . . | ||||||
|  | WORKDIR /src/src/Services/Location/Locations.API | ||||||
|  | RUN dotnet build -c Release -o /app | ||||||
|  | 
 | ||||||
|  | FROM build AS publish | ||||||
|  | RUN dotnet publish -c Release -o /app | ||||||
|  | 
 | ||||||
|  | FROM base AS final | ||||||
|  | WORKDIR /app | ||||||
|  | COPY --from=publish /app . | ||||||
| ENTRYPOINT ["dotnet", "Locations.API.dll"] | ENTRYPOINT ["dotnet", "Locations.API.dll"] | ||||||
|  | |||||||
| @ -1,3 +0,0 @@ | |||||||
| * |  | ||||||
| !obj/Docker/publish/* |  | ||||||
| !obj/Docker/empty/ |  | ||||||
| @ -1,6 +1,27 @@ | |||||||
| FROM microsoft/aspnetcore:2.0 | FROM microsoft/aspnetcore:2.0 AS base | ||||||
| ARG source |  | ||||||
| WORKDIR /app | WORKDIR /app | ||||||
| EXPOSE 80 | EXPOSE 80 | ||||||
| COPY ${source:-obj/Docker/publish} . | 
 | ||||||
|  | FROM microsoft/aspnetcore-build:2.0 AS build | ||||||
|  | WORKDIR /src | ||||||
|  | COPY eShopOnContainers-ServicesAndWebApps.sln ./ | ||||||
|  | COPY src/Services/Marketing/Marketing.API/Marketing.API.csproj src/Services/Marketing/Marketing.API/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/ | ||||||
|  | COPY src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj src/BuildingBlocks/EventBus/EventBusRabbitMQ/ | ||||||
|  | COPY src/BuildingBlocks/EventBus/EventBus/EventBus.csproj src/BuildingBlocks/EventBus/EventBus/ | ||||||
|  | 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/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.AzureStorage/Microsoft.Extensions.HealthChecks.AzureStorage.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.AzureStorage/ | ||||||
|  | RUN dotnet restore | ||||||
|  | COPY . . | ||||||
|  | WORKDIR /src/src/Services/Marketing/Marketing.API | ||||||
|  | RUN dotnet build -c Release -o /app | ||||||
|  | 
 | ||||||
|  | FROM build AS publish | ||||||
|  | RUN dotnet publish -c Release -o /app | ||||||
|  | 
 | ||||||
|  | FROM base AS final | ||||||
|  | WORKDIR /app | ||||||
|  | COPY --from=publish /app . | ||||||
| ENTRYPOINT ["dotnet", "Marketing.API.dll"] | ENTRYPOINT ["dotnet", "Marketing.API.dll"] | ||||||
|  | |||||||
| @ -45,9 +45,6 @@ | |||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
| 
 | 
 | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|     <None Update="Dockerfile"> |  | ||||||
|       <CopyToOutputDirectory>Always</CopyToOutputDirectory> |  | ||||||
|     </None> |  | ||||||
|     <None Update="Pics\*"> |     <None Update="Pics\*"> | ||||||
|       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||||
|     </None> |     </None> | ||||||
|  | |||||||
| @ -1,3 +0,0 @@ | |||||||
| * |  | ||||||
| !obj/Docker/publish/* |  | ||||||
| !obj/Docker/empty/ |  | ||||||
| @ -28,6 +28,11 @@ namespace Ordering.API.Application.Commands | |||||||
|         public async Task<bool> Handle(CancelOrderCommand command) |         public async Task<bool> Handle(CancelOrderCommand command) | ||||||
|         { |         { | ||||||
|             var orderToUpdate = await _orderRepository.GetAsync(command.OrderNumber); |             var orderToUpdate = await _orderRepository.GetAsync(command.OrderNumber); | ||||||
|  |             if(orderToUpdate == null) | ||||||
|  |             { | ||||||
|  |                 return false; | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|             orderToUpdate.SetCancelledStatus(); |             orderToUpdate.SetCancelledStatus(); | ||||||
|             return await _orderRepository.UnitOfWork.SaveEntitiesAsync(); |             return await _orderRepository.UnitOfWork.SaveEntitiesAsync(); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -25,6 +25,11 @@ namespace Ordering.API.Application.Commands | |||||||
|         public async Task<bool> Handle(ShipOrderCommand command) |         public async Task<bool> Handle(ShipOrderCommand command) | ||||||
|         { |         { | ||||||
|             var orderToUpdate = await _orderRepository.GetAsync(command.OrderNumber); |             var orderToUpdate = await _orderRepository.GetAsync(command.OrderNumber); | ||||||
|  |             if(orderToUpdate == null) | ||||||
|  |             { | ||||||
|  |                 return false; | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|             orderToUpdate.SetShippedStatus(); |             orderToUpdate.SetShippedStatus(); | ||||||
|             return await _orderRepository.UnitOfWork.SaveEntitiesAsync(); |             return await _orderRepository.UnitOfWork.SaveEntitiesAsync(); | ||||||
|         } |         } | ||||||
|  | |||||||
| @ -1,6 +1,30 @@ | |||||||
| FROM microsoft/aspnetcore:2.0 | FROM microsoft/aspnetcore:2.0 AS base | ||||||
| ARG source |  | ||||||
| WORKDIR /app | WORKDIR /app | ||||||
| EXPOSE 80 | EXPOSE 80 | ||||||
| COPY ${source:-obj/Docker/publish} . | 
 | ||||||
|  | FROM microsoft/aspnetcore-build:2.0 AS build | ||||||
|  | WORKDIR /src | ||||||
|  | COPY eShopOnContainers-ServicesAndWebApps.sln ./ | ||||||
|  | COPY src/Services/Ordering/Ordering.API/Ordering.API.csproj src/Services/Ordering/Ordering.API/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/ | ||||||
|  | COPY src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj src/BuildingBlocks/EventBus/IntegrationEventLogEF/ | ||||||
|  | COPY src/BuildingBlocks/EventBus/EventBus/EventBus.csproj src/BuildingBlocks/EventBus/EventBus/ | ||||||
|  | COPY src/BuildingBlocks/EventBus/EventBusRabbitMQ/EventBusRabbitMQ.csproj src/BuildingBlocks/EventBus/EventBusRabbitMQ/ | ||||||
|  | COPY src/Services/Ordering/Ordering.Domain/Ordering.Domain.csproj src/Services/Ordering/Ordering.Domain/ | ||||||
|  | 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/ | ||||||
|  | COPY src/Services/Ordering/Ordering.Infrastructure/Ordering.Infrastructure.csproj src/Services/Ordering/Ordering.Infrastructure/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/Microsoft.Extensions.HealthChecks.SqlServer.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/ | ||||||
|  | RUN dotnet restore | ||||||
|  | COPY . . | ||||||
|  | WORKDIR /src/src/Services/Ordering/Ordering.API | ||||||
|  | RUN dotnet build -c Release -o /app | ||||||
|  | 
 | ||||||
|  | FROM build AS publish | ||||||
|  | RUN dotnet publish -c Release -o /app | ||||||
|  | 
 | ||||||
|  | FROM base AS final | ||||||
|  | WORKDIR /app | ||||||
|  | COPY --from=publish /app . | ||||||
| ENTRYPOINT ["dotnet", "Ordering.API.dll"] | ENTRYPOINT ["dotnet", "Ordering.API.dll"] | ||||||
|  | |||||||
| @ -11,9 +11,6 @@ | |||||||
|     <Content Update="web.config;"> |     <Content Update="web.config;"> | ||||||
|       <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> |       <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> | ||||||
|     </Content> |     </Content> | ||||||
|     <Content Include=".dockerignore;"> |  | ||||||
|       <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> |  | ||||||
|     </Content> |  | ||||||
|     <Content Include="Setup\**\*;"> |     <Content Include="Setup\**\*;"> | ||||||
|       <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> |       <CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory> | ||||||
|     </Content> |     </Content> | ||||||
| @ -54,9 +51,6 @@ | |||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
| 
 | 
 | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|     <None Update="Dockerfile"> |  | ||||||
|       <CopyToOutputDirectory>Always</CopyToOutputDirectory> |  | ||||||
|     </None> |  | ||||||
|     <None Update="Setup\*"> |     <None Update="Setup\*"> | ||||||
|       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||||
|     </None> |     </None> | ||||||
|  | |||||||
| @ -1,3 +0,0 @@ | |||||||
| * |  | ||||||
| !obj/Docker/publish/* |  | ||||||
| !obj/Docker/empty/ |  | ||||||
| @ -1,6 +1,27 @@ | |||||||
| FROM microsoft/aspnetcore:2.0 | FROM microsoft/aspnetcore:2.0 AS base | ||||||
| ARG source |  | ||||||
| WORKDIR /app | WORKDIR /app | ||||||
| EXPOSE 80 | EXPOSE 80 | ||||||
| COPY ${source:-obj/Docker/publish} . | 
 | ||||||
|  | FROM microsoft/aspnetcore-build:2.0 AS build | ||||||
|  | WORKDIR /src | ||||||
|  | COPY eShopOnContainers-ServicesAndWebApps.sln ./ | ||||||
|  | COPY src/Services/Payment/Payment.API/Payment.API.csproj src/Services/Payment/Payment.API/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/ | ||||||
|  | COPY src/BuildingBlocks/EventBus/IntegrationEventLogEF/IntegrationEventLogEF.csproj src/BuildingBlocks/EventBus/IntegrationEventLogEF/ | ||||||
|  | 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/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/Microsoft.Extensions.HealthChecks.SqlServer.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks.SqlServer/ | ||||||
|  | RUN dotnet restore | ||||||
|  | COPY . . | ||||||
|  | WORKDIR /src/src/Services/Payment/Payment.API | ||||||
|  | RUN dotnet build -c Release -o /app | ||||||
|  | 
 | ||||||
|  | FROM build AS publish | ||||||
|  | RUN dotnet publish -c Release -o /app | ||||||
|  | 
 | ||||||
|  | FROM base AS final | ||||||
|  | WORKDIR /app | ||||||
|  | COPY --from=publish /app . | ||||||
| ENTRYPOINT ["dotnet", "Payment.API.dll"] | ENTRYPOINT ["dotnet", "Payment.API.dll"] | ||||||
|  | |||||||
| @ -150,9 +150,6 @@ | |||||||
|       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> |       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||||||
|     </Content> |     </Content> | ||||||
|     <None Include="Dockerfile" /> |     <None Include="Dockerfile" /> | ||||||
|     <None Include=".dockerignore"> |  | ||||||
|       <DependentUpon>Dockerfile</DependentUpon> |  | ||||||
|     </None> |  | ||||||
|     <None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> |     <None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | ||||||
|     <None Include="Scripts\jquery-1.10.2.intellisense.js" /> |     <None Include="Scripts\jquery-1.10.2.intellisense.js" /> | ||||||
|     <Content Include="Scripts\bootstrap.js" /> |     <Content Include="Scripts\bootstrap.js" /> | ||||||
|  | |||||||
| @ -1,3 +0,0 @@ | |||||||
| * |  | ||||||
| !obj/Docker/publish/* |  | ||||||
| !obj/Docker/empty/ |  | ||||||
| @ -1,6 +1,26 @@ | |||||||
| FROM microsoft/aspnetcore:2.0 | FROM microsoft/aspnetcore:2.0 AS base | ||||||
| ARG source |  | ||||||
| WORKDIR /app | WORKDIR /app | ||||||
| EXPOSE 80 | EXPOSE 80 | ||||||
| COPY ${source:-obj/Docker/publish} . | 
 | ||||||
|  | FROM microsoft/aspnetcore-build:2.0 AS build | ||||||
|  | WORKDIR /src | ||||||
|  | COPY eShopOnContainers-ServicesAndWebApps.sln ./ | ||||||
|  | COPY src/Web/WebMVC/WebMVC.csproj src/Web/WebMVC/ | ||||||
|  | COPY src/BuildingBlocks/DataProtection/DataProtection/DataProtection.csproj src/BuildingBlocks/DataProtection/DataProtection/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/ | ||||||
|  | COPY src/BuildingBlocks/Resilience/Resilience.Http/Resilience.Http.csproj src/BuildingBlocks/Resilience/Resilience.Http/ | ||||||
|  | RUN dotnet restore | ||||||
|  | COPY . . | ||||||
|  | WORKDIR /src/src/Web/WebMVC | ||||||
|  | RUN dotnet build -c Release -o /app | ||||||
|  | 
 | ||||||
|  | FROM build AS publish | ||||||
|  | RUN bower install --allow-root | ||||||
|  | RUN dotnet bundle | ||||||
|  | RUN dotnet publish -c Release -o /app | ||||||
|  | 
 | ||||||
|  | FROM base AS final | ||||||
|  | WORKDIR /app | ||||||
|  | COPY --from=publish /app . | ||||||
| ENTRYPOINT ["dotnet", "WebMVC.dll"] | ENTRYPOINT ["dotnet", "WebMVC.dll"] | ||||||
|  | |||||||
| @ -28,10 +28,10 @@ | |||||||
|     <PackageReference Include="Microsoft.VisualStudio.Azure.Fabric.MSBuild" Version="1.6.2" /> |     <PackageReference Include="Microsoft.VisualStudio.Azure.Fabric.MSBuild" Version="1.6.2" /> | ||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
| 
 | 
 | ||||||
|   <Target Name="PrepublishScript" BeforeTargets="PrepareForPublish"> |   <!--<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish"> | ||||||
|     <Exec Command="bower install --allow-root" /> |     <Exec Command="bower install - -allow-root" /> | ||||||
|     <Exec Command="dotnet bundle" Condition="'$(ASPNETCORE_ENVIRONMENT)'!='Development'" /> |     <Exec Command="dotnet bundle" Condition="'$(ASPNETCORE_ENVIRONMENT)'!='Development'" /> | ||||||
|   </Target> |   </Target>--> | ||||||
| 
 | 
 | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|     <DotNetCliToolReference Include="BundlerMinifier.Core" Version="2.5.357" /> |     <DotNetCliToolReference Include="BundlerMinifier.Core" Version="2.5.357" /> | ||||||
| @ -45,12 +45,6 @@ | |||||||
|     <ProjectReference Include="..\..\BuildingBlocks\Resilience\Resilience.Http\Resilience.Http.csproj" /> |     <ProjectReference Include="..\..\BuildingBlocks\Resilience\Resilience.Http\Resilience.Http.csproj" /> | ||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
| 
 | 
 | ||||||
|   <ItemGroup> |  | ||||||
|     <None Update="Dockerfile"> |  | ||||||
|       <CopyToOutputDirectory>Always</CopyToOutputDirectory> |  | ||||||
|     </None> |  | ||||||
|   </ItemGroup> |  | ||||||
| 
 |  | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|     <None Include="ViewModels\CampaignItem.cs" /> |     <None Include="ViewModels\CampaignItem.cs" /> | ||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
|  | |||||||
| @ -1,3 +0,0 @@ | |||||||
| * |  | ||||||
| !obj/Docker/publish/* |  | ||||||
| !obj/Docker/empty/ |  | ||||||
| @ -1,3 +0,0 @@ | |||||||
| * |  | ||||||
| !obj/Docker/publish/* |  | ||||||
| !obj/Docker/empty/ |  | ||||||
| @ -1,6 +1,26 @@ | |||||||
| FROM microsoft/aspnetcore:2.0 | FROM microsoft/aspnetcore:2.0 AS base | ||||||
| ARG source |  | ||||||
| WORKDIR /app | WORKDIR /app | ||||||
| EXPOSE 80 | EXPOSE 80 | ||||||
| COPY ${source:-obj/Docker/publish} . | 
 | ||||||
|  | FROM microsoft/aspnetcore-build:2.0 AS build | ||||||
|  | WORKDIR /src | ||||||
|  | COPY eShopOnContainers-ServicesAndWebApps.sln ./ | ||||||
|  | COPY src/Web/WebSPA/WebSPA.csproj src/Web/WebSPA/ | ||||||
|  | COPY src/BuildingBlocks/DataProtection/DataProtection/DataProtection.csproj src/BuildingBlocks/DataProtection/DataProtection/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/ | ||||||
|  | RUN dotnet restore | ||||||
|  | COPY . . | ||||||
|  | WORKDIR /src/src/Web/WebSPA | ||||||
|  | RUN dotnet build -c Release -o /app | ||||||
|  | 
 | ||||||
|  | FROM build AS publish | ||||||
|  | RUN npm rebuild node-sass | ||||||
|  | RUN npm install | ||||||
|  | RUN npm run build:prod | ||||||
|  | RUN dotnet publish -c Release -o /app | ||||||
|  | 
 | ||||||
|  | FROM base AS final | ||||||
|  | WORKDIR /app | ||||||
|  | COPY --from=publish /app . | ||||||
| ENTRYPOINT ["dotnet", "WebSPA.dll"] | ENTRYPOINT ["dotnet", "WebSPA.dll"] | ||||||
|  | |||||||
| @ -37,14 +37,14 @@ | |||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
| 
 | 
 | ||||||
|   <!-- workaround for https://github.com/aspnet/websdk/issues/114 --> |   <!-- workaround for https://github.com/aspnet/websdk/issues/114 --> | ||||||
|   <Target Name="PrepublishScript" BeforeTargets="PrepareForPublish"> |   <!--<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish"> | ||||||
|     <Exec Command="npm install" /> |     <Exec Command="npm install" /> | ||||||
|     <Exec Command="npm run build:prod" /> |     <Exec Command="npm run build:prod" /> | ||||||
|     <ItemGroup> |     <ItemGroup> | ||||||
|       <_GeneratedFiles Include="$(GeneratedItemPatterns)" /> |       <_GeneratedFiles Include="$(GeneratedItemPatterns)" /> | ||||||
|       <ContentWithTargetPath Include="@(_GeneratedFiles)" TargetPath="%(Identity)" CopyToPublishDirectory="PreserveNewest" /> |       <ContentWithTargetPath Include="@(_GeneratedFiles)" TargetPath="%(Identity)" CopyToPublishDirectory="PreserveNewest" /> | ||||||
|     </ItemGroup> |     </ItemGroup> | ||||||
|   </Target> |   </Target>--> | ||||||
| 
 | 
 | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|     <DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0" /> |     <DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="2.0.0" /> | ||||||
| @ -66,12 +66,6 @@ | |||||||
|     <ProjectReference Include="..\..\BuildingBlocks\HealthChecks\src\Microsoft.Extensions.HealthChecks\Microsoft.Extensions.HealthChecks.csproj" /> |     <ProjectReference Include="..\..\BuildingBlocks\HealthChecks\src\Microsoft.Extensions.HealthChecks\Microsoft.Extensions.HealthChecks.csproj" /> | ||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
| 
 | 
 | ||||||
|   <ItemGroup> |  | ||||||
|     <None Update="Dockerfile"> |  | ||||||
|       <CopyToOutputDirectory>Always</CopyToOutputDirectory> |  | ||||||
|     </None> |  | ||||||
|   </ItemGroup> |  | ||||||
| 
 |  | ||||||
|   <ItemGroup> |   <ItemGroup> | ||||||
|     <Folder Include="wwwroot\assets\" /> |     <Folder Include="wwwroot\assets\" /> | ||||||
|   </ItemGroup> |   </ItemGroup> | ||||||
|  | |||||||
							
								
								
									
										30
									
								
								src/Web/WebSPA/package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										30
									
								
								src/Web/WebSPA/package-lock.json
									
									
									
										generated
									
									
									
								
							| @ -9243,15 +9243,6 @@ | |||||||
|           "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", |           "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", | ||||||
|           "dev": true |           "dev": true | ||||||
|         }, |         }, | ||||||
|         "string_decoder": { |  | ||||||
|           "version": "1.0.3", |  | ||||||
|           "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", |  | ||||||
|           "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", |  | ||||||
|           "dev": true, |  | ||||||
|           "requires": { |  | ||||||
|             "safe-buffer": "5.1.1" |  | ||||||
|           } |  | ||||||
|         }, |  | ||||||
|         "string-width": { |         "string-width": { | ||||||
|           "version": "1.0.2", |           "version": "1.0.2", | ||||||
|           "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", |           "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", | ||||||
| @ -9263,6 +9254,15 @@ | |||||||
|             "strip-ansi": "3.0.1" |             "strip-ansi": "3.0.1" | ||||||
|           } |           } | ||||||
|         }, |         }, | ||||||
|  |         "string_decoder": { | ||||||
|  |           "version": "1.0.3", | ||||||
|  |           "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", | ||||||
|  |           "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", | ||||||
|  |           "dev": true, | ||||||
|  |           "requires": { | ||||||
|  |             "safe-buffer": "5.1.1" | ||||||
|  |           } | ||||||
|  |         }, | ||||||
|         "strip-ansi": { |         "strip-ansi": { | ||||||
|           "version": "3.0.1", |           "version": "3.0.1", | ||||||
|           "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", |           "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", | ||||||
| @ -10085,12 +10085,6 @@ | |||||||
|       "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", |       "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", | ||||||
|       "dev": true |       "dev": true | ||||||
|     }, |     }, | ||||||
|     "string_decoder": { |  | ||||||
|       "version": "0.10.31", |  | ||||||
|       "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", |  | ||||||
|       "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", |  | ||||||
|       "dev": true |  | ||||||
|     }, |  | ||||||
|     "string-width": { |     "string-width": { | ||||||
|       "version": "2.1.1", |       "version": "2.1.1", | ||||||
|       "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", |       "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", | ||||||
| @ -10118,6 +10112,12 @@ | |||||||
|         } |         } | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|  |     "string_decoder": { | ||||||
|  |       "version": "0.10.31", | ||||||
|  |       "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", | ||||||
|  |       "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", | ||||||
|  |       "dev": true | ||||||
|  |     }, | ||||||
|     "stringstream": { |     "stringstream": { | ||||||
|       "version": "0.0.5", |       "version": "0.0.5", | ||||||
|       "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", |       "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", | ||||||
|  | |||||||
| @ -1,3 +0,0 @@ | |||||||
| * |  | ||||||
| !obj/Docker/publish/* |  | ||||||
| !obj/Docker/empty/ |  | ||||||
| @ -1,6 +1,22 @@ | |||||||
| FROM microsoft/aspnetcore:2.0 | FROM microsoft/aspnetcore:2.0 AS base | ||||||
| ARG source |  | ||||||
| WORKDIR /app | WORKDIR /app | ||||||
| EXPOSE 80 | EXPOSE 80 | ||||||
| COPY ${source:-obj/Docker/publish} . | 
 | ||||||
|  | FROM microsoft/aspnetcore-build:2.0 AS build | ||||||
|  | WORKDIR /src | ||||||
|  | COPY eShopOnContainers-ServicesAndWebApps.sln ./ | ||||||
|  | COPY src/Web/WebStatus/WebStatus.csproj src/Web/WebStatus/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/Microsoft.AspNetCore.HealthChecks.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.AspNetCore.HealthChecks/ | ||||||
|  | COPY src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/Microsoft.Extensions.HealthChecks.csproj src/BuildingBlocks/HealthChecks/src/Microsoft.Extensions.HealthChecks/ | ||||||
|  | RUN dotnet restore | ||||||
|  | COPY . . | ||||||
|  | WORKDIR /src/src/Web/WebStatus | ||||||
|  | RUN dotnet build -c Release -o /app | ||||||
|  | 
 | ||||||
|  | FROM build AS publish | ||||||
|  | RUN dotnet publish -c Release -o /app | ||||||
|  | 
 | ||||||
|  | FROM base AS final | ||||||
|  | WORKDIR /app | ||||||
|  | COPY --from=publish /app . | ||||||
| ENTRYPOINT ["dotnet", "WebStatus.dll"] | ENTRYPOINT ["dotnet", "WebStatus.dll"] | ||||||
|  | |||||||
| @ -10,7 +10,8 @@ | |||||||
|   "IdentityUrl": "http://localhost:5105", |   "IdentityUrl": "http://localhost:5105", | ||||||
|   "ConnectionString": "127.0.0.1", |   "ConnectionString": "127.0.0.1", | ||||||
|   "isTest": "true", |   "isTest": "true", | ||||||
|   "EventBusConnection": "localhost" |   "EventBusConnection": "localhost", | ||||||
|  |   "SubscriptionClientName": "Basket" | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -1,13 +1,13 @@ | |||||||
| using FunctionalTests.Middleware; | using Microsoft.AspNetCore; | ||||||
| using Microsoft.AspNetCore; |  | ||||||
| using Microsoft.AspNetCore.Hosting; | using Microsoft.AspNetCore.Hosting; | ||||||
| using Microsoft.AspNetCore.TestHost; | using Microsoft.AspNetCore.TestHost; | ||||||
|  | using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF; | ||||||
| using Microsoft.eShopOnContainers.Services.Catalog.API; | using Microsoft.eShopOnContainers.Services.Catalog.API; | ||||||
| using Microsoft.Extensions.Configuration; | using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure; | ||||||
| using System; | using Microsoft.Extensions.DependencyInjection; | ||||||
| using System.Collections.Generic; | using Microsoft.Extensions.Logging; | ||||||
|  | using Microsoft.Extensions.Options; | ||||||
| using System.IO; | using System.IO; | ||||||
| using System.Text; |  | ||||||
| 
 | 
 | ||||||
| namespace FunctionalTests.Services.Catalog | namespace FunctionalTests.Services.Catalog | ||||||
| { | { | ||||||
| @ -19,7 +19,22 @@ namespace FunctionalTests.Services.Catalog | |||||||
|             webHostBuilder.UseContentRoot(Directory.GetCurrentDirectory() + "\\Services\\Catalog"); |             webHostBuilder.UseContentRoot(Directory.GetCurrentDirectory() + "\\Services\\Catalog"); | ||||||
|             webHostBuilder.UseStartup<Startup>(); |             webHostBuilder.UseStartup<Startup>(); | ||||||
| 
 | 
 | ||||||
|             return new TestServer(webHostBuilder); |             var testServer = new TestServer(webHostBuilder); | ||||||
|  | 
 | ||||||
|  |             testServer.Host | ||||||
|  |                 .MigrateDbContext<CatalogContext>((context, services) => | ||||||
|  |                 { | ||||||
|  |                     var env = services.GetService<IHostingEnvironment>(); | ||||||
|  |                     var settings = services.GetService<IOptions<CatalogSettings>>(); | ||||||
|  |                     var logger = services.GetService<ILogger<CatalogContextSeed>>(); | ||||||
|  | 
 | ||||||
|  |                     new CatalogContextSeed() | ||||||
|  |                     .SeedAsync(context, env, settings, logger) | ||||||
|  |                     .Wait(); | ||||||
|  |                 }) | ||||||
|  |                 .MigrateDbContext<IntegrationEventLogContext>((_, __) => { }); | ||||||
|  | 
 | ||||||
|  |             return testServer; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         public static class Get |         public static class Get | ||||||
|  | |||||||
| @ -4,5 +4,6 @@ | |||||||
|   "IdentityUrl": "http://localhost:5105", |   "IdentityUrl": "http://localhost:5105", | ||||||
|   "isTest": "true", |   "isTest": "true", | ||||||
|   "EventBusConnection": "localhost", |   "EventBusConnection": "localhost", | ||||||
|   "PicBaseUrl": "http://localhost:5101/api/v1/catalog/items/[0]/pic/" |   "PicBaseUrl": "http://localhost:5101/api/v1/catalog/items/[0]/pic/", | ||||||
|  |   "SubscriptionClientName": "Catalog" | ||||||
| } | } | ||||||
|  | |||||||
| @ -4,5 +4,6 @@ | |||||||
|   "ExternalCatalogBaseUrl": "http://localhost:5101", |   "ExternalCatalogBaseUrl": "http://localhost:5101", | ||||||
|   "IdentityUrl": "http://localhost:5105", |   "IdentityUrl": "http://localhost:5105", | ||||||
|   "isTest": "true", |   "isTest": "true", | ||||||
|   "EventBusConnection": "localhost" |   "EventBusConnection": "localhost", | ||||||
|  |   "SubscriptionClientName": "Location" | ||||||
| } | } | ||||||
|  | |||||||
| @ -3,7 +3,9 @@ | |||||||
|     using Microsoft.AspNetCore; |     using Microsoft.AspNetCore; | ||||||
|     using Microsoft.AspNetCore.Hosting; |     using Microsoft.AspNetCore.Hosting; | ||||||
|     using Microsoft.AspNetCore.TestHost; |     using Microsoft.AspNetCore.TestHost; | ||||||
|     using Microsoft.Extensions.Configuration; |     using Microsoft.eShopOnContainers.Services.Marketing.API.Infrastructure; | ||||||
|  |     using Microsoft.Extensions.DependencyInjection; | ||||||
|  |     using Microsoft.Extensions.Logging; | ||||||
|     using System.IO; |     using System.IO; | ||||||
| 
 | 
 | ||||||
|     public class MarketingScenariosBase |     public class MarketingScenariosBase | ||||||
| @ -16,7 +18,19 @@ | |||||||
|             webHostBuilder.UseContentRoot(Directory.GetCurrentDirectory() + "\\Services\\Marketing"); |             webHostBuilder.UseContentRoot(Directory.GetCurrentDirectory() + "\\Services\\Marketing"); | ||||||
|             webHostBuilder.UseStartup<MarketingTestsStartup>(); |             webHostBuilder.UseStartup<MarketingTestsStartup>(); | ||||||
| 
 | 
 | ||||||
|             return new TestServer(webHostBuilder); |             var testServer = new TestServer(webHostBuilder); | ||||||
|  | 
 | ||||||
|  |             testServer.Host | ||||||
|  |                .MigrateDbContext<MarketingContext>((context, services) => | ||||||
|  |                { | ||||||
|  |                    var logger = services.GetService<ILogger<MarketingContextSeed>>(); | ||||||
|  | 
 | ||||||
|  |                    new MarketingContextSeed() | ||||||
|  |                        .SeedAsync(context, logger) | ||||||
|  |                        .Wait(); | ||||||
|  |                }); | ||||||
|  | 
 | ||||||
|  |             return testServer; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @ -7,5 +7,6 @@ | |||||||
|   "EventBusConnection": "localhost", |   "EventBusConnection": "localhost", | ||||||
|   "AzureServiceBusEnabled": false, |   "AzureServiceBusEnabled": false, | ||||||
|   "SubscriptionClientName": "Marketing", |   "SubscriptionClientName": "Marketing", | ||||||
|   "PicBaseUrl": "http://localhost:5110/api/v1/campaigns/[0]/pic/" |   "PicBaseUrl": "http://localhost:5110/api/v1/campaigns/[0]/pic/", | ||||||
|  |   "SubscriptionClientName": "Marketing" | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,11 +1,15 @@ | |||||||
| using Microsoft.AspNetCore; | using Microsoft.AspNetCore; | ||||||
| using Microsoft.AspNetCore.Hosting; | using Microsoft.AspNetCore.Hosting; | ||||||
| using Microsoft.AspNetCore.TestHost; | using Microsoft.AspNetCore.TestHost; | ||||||
|  | using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF; | ||||||
|  | using Microsoft.eShopOnContainers.Services.Ordering.API; | ||||||
|  | using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure; | ||||||
|  | using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure; | ||||||
| using Microsoft.Extensions.Configuration; | using Microsoft.Extensions.Configuration; | ||||||
| using System; | using Microsoft.Extensions.DependencyInjection; | ||||||
| using System.Collections.Generic; | using Microsoft.Extensions.Logging; | ||||||
|  | using Microsoft.Extensions.Options; | ||||||
| using System.IO; | using System.IO; | ||||||
| using System.Text; |  | ||||||
| 
 | 
 | ||||||
| namespace FunctionalTests.Services.Ordering | namespace FunctionalTests.Services.Ordering | ||||||
| { | { | ||||||
| @ -21,8 +25,22 @@ namespace FunctionalTests.Services.Ordering | |||||||
|                  config.AddJsonFile("settings.json"); |                  config.AddJsonFile("settings.json"); | ||||||
|              }); |              }); | ||||||
| 
 | 
 | ||||||
|  |             var testServer = new TestServer(webHostBuilder); | ||||||
| 
 | 
 | ||||||
|             return new TestServer(webHostBuilder); |             testServer.Host | ||||||
|  |                 .MigrateDbContext<OrderingContext>((context, services) => | ||||||
|  |                 { | ||||||
|  |                     var env = services.GetService<IHostingEnvironment>(); | ||||||
|  |                     var settings = services.GetService<IOptions<OrderingSettings>>(); | ||||||
|  |                     var logger = services.GetService<ILogger<OrderingContextSeed>>(); | ||||||
|  | 
 | ||||||
|  |                     new OrderingContextSeed() | ||||||
|  |                         .SeedAsync(context, env, settings, logger) | ||||||
|  |                         .Wait(); | ||||||
|  |                 }) | ||||||
|  |                 .MigrateDbContext<IntegrationEventLogContext>((_, __) => { }); | ||||||
|  | 
 | ||||||
|  |             return testServer; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         public static class Get |         public static class Get | ||||||
|  | |||||||
| @ -5,5 +5,6 @@ | |||||||
|   "isTest": "true", |   "isTest": "true", | ||||||
|   "EventBusConnection": "localhost", |   "EventBusConnection": "localhost", | ||||||
|   "CheckUpdateTime": "30000", |   "CheckUpdateTime": "30000", | ||||||
|   "GracePeriodTime": "1" |   "GracePeriodTime": "1", | ||||||
|  |   "SubscriptionClientName": "Ordering" | ||||||
| } | } | ||||||
|  | |||||||
| @ -10,7 +10,8 @@ | |||||||
|   "IdentityUrl": "http://localhost:5105", |   "IdentityUrl": "http://localhost:5105", | ||||||
|   "ConnectionString": "127.0.0.1", |   "ConnectionString": "127.0.0.1", | ||||||
|   "isTest": "true", |   "isTest": "true", | ||||||
|   "EventBusConnection": "localhost" |   "EventBusConnection": "localhost", | ||||||
|  |   "SubscriptionClientName": "Basket" | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -3,7 +3,12 @@ | |||||||
|     using Microsoft.AspNetCore; |     using Microsoft.AspNetCore; | ||||||
|     using Microsoft.AspNetCore.Hosting; |     using Microsoft.AspNetCore.Hosting; | ||||||
|     using Microsoft.AspNetCore.TestHost; |     using Microsoft.AspNetCore.TestHost; | ||||||
|  |     using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF; | ||||||
|     using Microsoft.eShopOnContainers.Services.Catalog.API; |     using Microsoft.eShopOnContainers.Services.Catalog.API; | ||||||
|  |     using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure; | ||||||
|  |     using Microsoft.Extensions.DependencyInjection; | ||||||
|  |     using Microsoft.Extensions.Logging; | ||||||
|  |     using Microsoft.Extensions.Options; | ||||||
|     using System.IO; |     using System.IO; | ||||||
| 
 | 
 | ||||||
|     public class CatalogScenarioBase |     public class CatalogScenarioBase | ||||||
| @ -14,7 +19,22 @@ | |||||||
|             webHostBuilder.UseContentRoot(Directory.GetCurrentDirectory() + "\\Services\\Catalog"); |             webHostBuilder.UseContentRoot(Directory.GetCurrentDirectory() + "\\Services\\Catalog"); | ||||||
|             webHostBuilder.UseStartup<Startup>(); |             webHostBuilder.UseStartup<Startup>(); | ||||||
| 
 | 
 | ||||||
|             return new TestServer(webHostBuilder); |             var testServer = new TestServer(webHostBuilder); | ||||||
|  | 
 | ||||||
|  |             testServer.Host | ||||||
|  |                 .MigrateDbContext<CatalogContext>((context, services) => | ||||||
|  |                 { | ||||||
|  |                     var env = services.GetService<IHostingEnvironment>(); | ||||||
|  |                     var settings = services.GetService<IOptions<CatalogSettings>>(); | ||||||
|  |                     var logger = services.GetService<ILogger<CatalogContextSeed>>(); | ||||||
|  | 
 | ||||||
|  |                     new CatalogContextSeed() | ||||||
|  |                     .SeedAsync(context, env, settings, logger) | ||||||
|  |                     .Wait(); | ||||||
|  |                 }) | ||||||
|  |                 .MigrateDbContext<IntegrationEventLogContext>((_, __) => { }); | ||||||
|  | 
 | ||||||
|  |             return testServer; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         public static class Get |         public static class Get | ||||||
|  | |||||||
| @ -4,5 +4,6 @@ | |||||||
|   "IdentityUrl": "http://localhost:5105", |   "IdentityUrl": "http://localhost:5105", | ||||||
|   "isTest": "true", |   "isTest": "true", | ||||||
|   "EventBusConnection": "localhost", |   "EventBusConnection": "localhost", | ||||||
|   "PicBaseUrl": "http://localhost:5101/api/v1/catalog/items/[0]/pic/" |   "PicBaseUrl": "http://localhost:5101/api/v1/catalog/items/[0]/pic/", | ||||||
|  |   "SubscriptionClientName": "Catalog" | ||||||
| } | } | ||||||
|  | |||||||
| @ -4,5 +4,6 @@ | |||||||
|   "ExternalCatalogBaseUrl": "http://localhost:5101", |   "ExternalCatalogBaseUrl": "http://localhost:5101", | ||||||
|   "IdentityUrl": "http://localhost:5105", |   "IdentityUrl": "http://localhost:5105", | ||||||
|   "isTest": "true", |   "isTest": "true", | ||||||
|   "EventBusConnection": "localhost" |   "EventBusConnection": "localhost", | ||||||
|  |   "SubscriptionClientName": "Locations" | ||||||
| } | } | ||||||
|  | |||||||
| @ -3,6 +3,9 @@ | |||||||
|     using Microsoft.AspNetCore; |     using Microsoft.AspNetCore; | ||||||
|     using Microsoft.AspNetCore.Hosting; |     using Microsoft.AspNetCore.Hosting; | ||||||
|     using Microsoft.AspNetCore.TestHost; |     using Microsoft.AspNetCore.TestHost; | ||||||
|  |     using Microsoft.eShopOnContainers.Services.Marketing.API.Infrastructure; | ||||||
|  |     using Microsoft.Extensions.Logging; | ||||||
|  |     using Microsoft.Extensions.DependencyInjection; | ||||||
|     using System.IO; |     using System.IO; | ||||||
| 
 | 
 | ||||||
|     public class MarketingScenarioBase |     public class MarketingScenarioBase | ||||||
| @ -15,7 +18,20 @@ | |||||||
|             webHostBuilder.UseContentRoot(Directory.GetCurrentDirectory() + "\\Services\\Marketing"); |             webHostBuilder.UseContentRoot(Directory.GetCurrentDirectory() + "\\Services\\Marketing"); | ||||||
|             webHostBuilder.UseStartup<MarketingTestsStartup>(); |             webHostBuilder.UseStartup<MarketingTestsStartup>(); | ||||||
| 
 | 
 | ||||||
|             return new TestServer(webHostBuilder); |             var testServer = new TestServer(webHostBuilder); | ||||||
|  | 
 | ||||||
|  |             testServer.Host | ||||||
|  |                .MigrateDbContext<MarketingContext>((context, services) => | ||||||
|  |                { | ||||||
|  |                    var logger = services.GetService<ILogger<MarketingContextSeed>>(); | ||||||
|  | 
 | ||||||
|  |                    new MarketingContextSeed() | ||||||
|  |                        .SeedAsync(context, logger) | ||||||
|  |                        .Wait(); | ||||||
|  | 
 | ||||||
|  |                }); | ||||||
|  | 
 | ||||||
|  |             return testServer; | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| } | } | ||||||
| @ -5,5 +5,6 @@ | |||||||
|   "IdentityUrl": "http://localhost:5105", |   "IdentityUrl": "http://localhost:5105", | ||||||
|   "isTest": "true", |   "isTest": "true", | ||||||
|   "EventBusConnection": "localhost", |   "EventBusConnection": "localhost", | ||||||
|   "PicBaseUrl": "http://localhost:5110/api/v1/campaigns/[0]/pic/" |   "PicBaseUrl": "http://localhost:5110/api/v1/campaigns/[0]/pic/", | ||||||
|  |   "SubscriptionClientName": "Marketing" | ||||||
| } | } | ||||||
|  | |||||||
| @ -4,8 +4,14 @@ | |||||||
|     using Microsoft.AspNetCore.Hosting; |     using Microsoft.AspNetCore.Hosting; | ||||||
|     using Microsoft.AspNetCore.TestHost; |     using Microsoft.AspNetCore.TestHost; | ||||||
|     using Microsoft.eShopOnContainers.Services.Ordering.API; |     using Microsoft.eShopOnContainers.Services.Ordering.API; | ||||||
|  |     using Microsoft.eShopOnContainers.Services.Ordering.API.Infrastructure; | ||||||
|  |     using Microsoft.eShopOnContainers.Services.Ordering.Infrastructure; | ||||||
|  |     using Microsoft.Extensions.DependencyInjection; | ||||||
|     using Microsoft.Extensions.Configuration; |     using Microsoft.Extensions.Configuration; | ||||||
|  |     using Microsoft.Extensions.Logging; | ||||||
|  |     using Microsoft.Extensions.Options; | ||||||
|     using System.IO; |     using System.IO; | ||||||
|  |     using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF; | ||||||
| 
 | 
 | ||||||
|     public class OrderingScenarioBase |     public class OrderingScenarioBase | ||||||
|     { |     { | ||||||
| @ -19,7 +25,22 @@ | |||||||
|                 config.AddJsonFile("settings.json"); |                 config.AddJsonFile("settings.json"); | ||||||
|             }); |             }); | ||||||
| 
 | 
 | ||||||
|             return new TestServer(webHostBuilder); |             var testServer = new TestServer(webHostBuilder); | ||||||
|  | 
 | ||||||
|  |             testServer.Host | ||||||
|  |                 .MigrateDbContext<OrderingContext>((context, services) => | ||||||
|  |                 { | ||||||
|  |                     var env = services.GetService<IHostingEnvironment>(); | ||||||
|  |                     var settings = services.GetService<IOptions<OrderingSettings>>(); | ||||||
|  |                     var logger = services.GetService<ILogger<OrderingContextSeed>>(); | ||||||
|  | 
 | ||||||
|  |                     new OrderingContextSeed() | ||||||
|  |                         .SeedAsync(context, env, settings, logger) | ||||||
|  |                         .Wait(); | ||||||
|  |                 }) | ||||||
|  |                 .MigrateDbContext<IntegrationEventLogContext>((_, __) => { }); | ||||||
|  | 
 | ||||||
|  |             return testServer; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         public static class Get |         public static class Get | ||||||
|  | |||||||
| @ -25,7 +25,7 @@ | |||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         [Fact] |         [Fact] | ||||||
|         public async Task Cancel_order_no_order_created_response_500_status_code() |         public async Task Cancel_order_no_order_created_bad_request_response() | ||||||
|         { |         { | ||||||
|             using (var server = CreateServer()) |             using (var server = CreateServer()) | ||||||
|             { |             { | ||||||
| @ -33,12 +33,12 @@ | |||||||
|                 var response = await server.CreateIdempotentClient() |                 var response = await server.CreateIdempotentClient() | ||||||
|                     .PutAsync(Put.CancelOrder, content); |                     .PutAsync(Put.CancelOrder, content); | ||||||
| 
 | 
 | ||||||
|                 Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode); |                 Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         [Fact] |         [Fact] | ||||||
|         public async Task Ship_order_no_order_created_response_500_status_code() |         public async Task Ship_order_no_order_created_bad_request_response() | ||||||
|         { |         { | ||||||
|             using (var server = CreateServer()) |             using (var server = CreateServer()) | ||||||
|             { |             { | ||||||
| @ -46,7 +46,7 @@ | |||||||
|                 var response = await server.CreateIdempotentClient() |                 var response = await server.CreateIdempotentClient() | ||||||
|                     .PutAsync(Put.ShipOrder, content); |                     .PutAsync(Put.ShipOrder, content); | ||||||
| 
 | 
 | ||||||
|                 Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode); |                 Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -5,5 +5,6 @@ | |||||||
|   "isTest": "true", |   "isTest": "true", | ||||||
|   "EventBusConnection": "localhost", |   "EventBusConnection": "localhost", | ||||||
|   "CheckUpdateTime": "30000", |   "CheckUpdateTime": "30000", | ||||||
|   "GracePeriodTime": "1" |   "GracePeriodTime": "1", | ||||||
|  |   "SubscriptionClientName": "Ordering" | ||||||
| } | } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user