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"?>
|
||||
<configuration>
|
||||
<config>
|
||||
<add key="repositoryPath" value="packages" />
|
||||
</config>
|
||||
<packageSources>
|
||||
<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" />
|
||||
|
@ -1,9 +1,14 @@
|
||||
version: '2'
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
sql.data:
|
||||
environment:
|
||||
- MSSQL_SA_PASSWORD=Pass@word
|
||||
- ACCEPT_EULA=Y
|
||||
- MSSQL_PID=Developer
|
||||
ports:
|
||||
- "5433:1433"
|
||||
- "5433:1433"
|
||||
|
||||
nosql.data:
|
||||
ports:
|
||||
- "27017:27017"
|
@ -13,3 +13,6 @@ services:
|
||||
image: rabbitmq
|
||||
ports:
|
||||
- "5672:5672"
|
||||
|
||||
nosql.data:
|
||||
image: mongo
|
||||
|
@ -9,6 +9,7 @@
|
||||
<ProjectVersion>2.0</ProjectVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<None Include=".dockerignore" />
|
||||
<None Include="docker-compose.ci.build.yml" />
|
||||
<None Include="docker-compose.override.yml">
|
||||
<DependentUpon>docker-compose.yml</DependentUpon>
|
||||
|
@ -5,8 +5,8 @@ services:
|
||||
basket.api:
|
||||
image: eshop/basket.api:${TAG:-latest}
|
||||
build:
|
||||
context: ./src/Services/Basket/Basket.API
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
dockerfile: ./src/Services/Basket/Basket.API/Dockerfile
|
||||
depends_on:
|
||||
- basket.data
|
||||
- identity.api
|
||||
@ -15,8 +15,8 @@ services:
|
||||
catalog.api:
|
||||
image: eshop/catalog.api:${TAG:-latest}
|
||||
build:
|
||||
context: ./src/Services/Catalog/Catalog.API
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
dockerfile: ./src/Services/Catalog/Catalog.API/Dockerfile
|
||||
depends_on:
|
||||
- sql.data
|
||||
- rabbitmq
|
||||
@ -24,16 +24,16 @@ services:
|
||||
identity.api:
|
||||
image: eshop/identity.api:${TAG:-latest}
|
||||
build:
|
||||
context: ./src/Services/Identity/Identity.API
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
dockerfile: ./src/Services/Identity/Identity.API/Dockerfile
|
||||
depends_on:
|
||||
- sql.data
|
||||
|
||||
ordering.api:
|
||||
image: eshop/ordering.api:${TAG:-latest}
|
||||
build:
|
||||
context: ./src/Services/Ordering/Ordering.API
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
dockerfile: ./src/Services/Ordering/Ordering.API/Dockerfile
|
||||
depends_on:
|
||||
- sql.data
|
||||
- rabbitmq
|
||||
@ -41,8 +41,8 @@ services:
|
||||
marketing.api:
|
||||
image: eshop/marketing.api:${TAG:-latest}
|
||||
build:
|
||||
context: ./src/Services/Marketing/Marketing.API
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
dockerfile: ./src/Services/Marketing/Marketing.API/Dockerfile
|
||||
depends_on:
|
||||
- sql.data
|
||||
- nosql.data
|
||||
@ -52,8 +52,8 @@ services:
|
||||
webspa:
|
||||
image: eshop/webspa:${TAG:-latest}
|
||||
build:
|
||||
context: ./src/Web/WebSPA
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
dockerfile: ./src/Web/WebSPA/Dockerfile
|
||||
depends_on:
|
||||
- catalog.api
|
||||
- ordering.api
|
||||
@ -64,8 +64,8 @@ services:
|
||||
webmvc:
|
||||
image: eshop/webmvc:${TAG:-latest}
|
||||
build:
|
||||
context: ./src/Web/WebMVC
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
dockerfile: ./src/Web/WebMVC/Dockerfile
|
||||
depends_on:
|
||||
- catalog.api
|
||||
- ordering.api
|
||||
@ -76,22 +76,22 @@ services:
|
||||
webstatus:
|
||||
image: eshop/webstatus:${TAG:-latest}
|
||||
build:
|
||||
context: ./src/Web/WebStatus
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
dockerfile: ./src/Web/WebStatus/Dockerfile
|
||||
|
||||
payment.api:
|
||||
image: eshop/payment.api:${TAG:-latest}
|
||||
build:
|
||||
context: ./src/Services/Payment/Payment.API
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
dockerfile: ./src/Services/Payment/Payment.API/Dockerfile
|
||||
depends_on:
|
||||
- rabbitmq
|
||||
|
||||
locations.api:
|
||||
image: eshop/locations.api:${TAG:-latest}
|
||||
build:
|
||||
context: ./src/Services/Location/Locations.API
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
dockerfile: ./src/Services/Location/Locations.API/Dockerfile
|
||||
depends_on:
|
||||
- nosql.data
|
||||
- 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
|
||||
* 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.
|
||||
* 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
|
||||
>```
|
||||
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:
|
||||
|
||||
<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:
|
||||
|
||||
>```
|
||||
>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">
|
||||
|
@ -4,13 +4,17 @@ The k8s directory contains Kubernetes configuration for the eShopOnContainers ap
|
||||
## 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 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".
|
||||
|
||||
>```
|
||||
>./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`.
|
||||
* 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 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 '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">
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
<Content Include=".dockerignore">
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@ -33,10 +30,4 @@
|
||||
<ProjectReference Include="..\..\..\BuildingBlocks\HealthChecks\src\Microsoft.Extensions.HealthChecks\Microsoft.Extensions.HealthChecks.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Dockerfile">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -1,6 +1,25 @@
|
||||
FROM microsoft/aspnetcore:2.0
|
||||
ARG source
|
||||
FROM microsoft/aspnetcore:2.0 AS base
|
||||
WORKDIR /app
|
||||
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"]
|
||||
|
@ -1,3 +0,0 @@
|
||||
*
|
||||
!obj/Docker/publish/*
|
||||
!obj/Docker/empty/
|
@ -61,9 +61,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Dockerfile">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Pics\*">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
@ -1,6 +1,29 @@
|
||||
FROM microsoft/aspnetcore:2.0
|
||||
ARG source
|
||||
FROM microsoft/aspnetcore:2.0 AS base
|
||||
WORKDIR /app
|
||||
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"]
|
||||
|
@ -1,3 +0,0 @@
|
||||
*
|
||||
!obj/Docker/publish/*
|
||||
!obj/Docker/empty/
|
@ -1,6 +1,25 @@
|
||||
FROM microsoft/aspnetcore:2.0.0
|
||||
ARG source
|
||||
FROM microsoft/aspnetcore:2.0 AS base
|
||||
WORKDIR /app
|
||||
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"]
|
||||
|
@ -51,9 +51,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Dockerfile">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Setup\*">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
@ -148,8 +148,6 @@ namespace Microsoft.eShopOnContainers.Services.Identity.API
|
||||
await next();
|
||||
});
|
||||
|
||||
app.UseAuthentication();
|
||||
|
||||
// Adds IdentityServer
|
||||
app.UseIdentityServer();
|
||||
|
||||
|
@ -1,3 +0,0 @@
|
||||
*
|
||||
!obj/Docker/publish/*
|
||||
!obj/Docker/empty/
|
@ -1,6 +1,25 @@
|
||||
FROM microsoft/aspnetcore:2.0
|
||||
ARG source
|
||||
FROM microsoft/aspnetcore:2.0 AS base
|
||||
WORKDIR /app
|
||||
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"]
|
||||
|
@ -1,3 +0,0 @@
|
||||
*
|
||||
!obj/Docker/publish/*
|
||||
!obj/Docker/empty/
|
@ -1,6 +1,27 @@
|
||||
FROM microsoft/aspnetcore:2.0
|
||||
ARG source
|
||||
FROM microsoft/aspnetcore:2.0 AS base
|
||||
WORKDIR /app
|
||||
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"]
|
||||
|
@ -45,9 +45,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Dockerfile">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Pics\*">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</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)
|
||||
{
|
||||
var orderToUpdate = await _orderRepository.GetAsync(command.OrderNumber);
|
||||
if(orderToUpdate == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
orderToUpdate.SetCancelledStatus();
|
||||
return await _orderRepository.UnitOfWork.SaveEntitiesAsync();
|
||||
}
|
||||
|
@ -25,6 +25,11 @@ namespace Ordering.API.Application.Commands
|
||||
public async Task<bool> Handle(ShipOrderCommand command)
|
||||
{
|
||||
var orderToUpdate = await _orderRepository.GetAsync(command.OrderNumber);
|
||||
if(orderToUpdate == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
orderToUpdate.SetShippedStatus();
|
||||
return await _orderRepository.UnitOfWork.SaveEntitiesAsync();
|
||||
}
|
||||
|
@ -1,6 +1,30 @@
|
||||
FROM microsoft/aspnetcore:2.0
|
||||
ARG source
|
||||
FROM microsoft/aspnetcore:2.0 AS base
|
||||
WORKDIR /app
|
||||
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"]
|
||||
|
@ -11,9 +11,6 @@
|
||||
<Content Update="web.config;">
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
<Content Include=".dockerignore;">
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
<Content Include="Setup\**\*;">
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
@ -54,9 +51,6 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Dockerfile">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="Setup\*">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
@ -1,3 +0,0 @@
|
||||
*
|
||||
!obj/Docker/publish/*
|
||||
!obj/Docker/empty/
|
@ -1,6 +1,27 @@
|
||||
FROM microsoft/aspnetcore:2.0
|
||||
ARG source
|
||||
FROM microsoft/aspnetcore:2.0 AS base
|
||||
WORKDIR /app
|
||||
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"]
|
||||
|
@ -150,9 +150,6 @@
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<None Include="Dockerfile" />
|
||||
<None Include=".dockerignore">
|
||||
<DependentUpon>Dockerfile</DependentUpon>
|
||||
</None>
|
||||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
|
||||
<None Include="Scripts\jquery-1.10.2.intellisense.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
|
||||
ARG source
|
||||
FROM microsoft/aspnetcore:2.0 AS base
|
||||
WORKDIR /app
|
||||
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"]
|
||||
|
@ -28,10 +28,10 @@
|
||||
<PackageReference Include="Microsoft.VisualStudio.Azure.Fabric.MSBuild" Version="1.6.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
|
||||
<Exec Command="bower install --allow-root" />
|
||||
<!--<Target Name="PrepublishScript" BeforeTargets="PrepareForPublish">
|
||||
<Exec Command="bower install - -allow-root" />
|
||||
<Exec Command="dotnet bundle" Condition="'$(ASPNETCORE_ENVIRONMENT)'!='Development'" />
|
||||
</Target>
|
||||
</Target>-->
|
||||
|
||||
<ItemGroup>
|
||||
<DotNetCliToolReference Include="BundlerMinifier.Core" Version="2.5.357" />
|
||||
@ -45,12 +45,6 @@
|
||||
<ProjectReference Include="..\..\BuildingBlocks\Resilience\Resilience.Http\Resilience.Http.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Dockerfile">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Include="ViewModels\CampaignItem.cs" />
|
||||
</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
|
||||
ARG source
|
||||
FROM microsoft/aspnetcore:2.0 AS base
|
||||
WORKDIR /app
|
||||
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"]
|
||||
|
@ -37,14 +37,14 @@
|
||||
</ItemGroup>
|
||||
|
||||
<!-- 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 run build:prod" />
|
||||
<ItemGroup>
|
||||
<_GeneratedFiles Include="$(GeneratedItemPatterns)" />
|
||||
<ContentWithTargetPath Include="@(_GeneratedFiles)" TargetPath="%(Identity)" CopyToPublishDirectory="PreserveNewest" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Target>-->
|
||||
|
||||
<ItemGroup>
|
||||
<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" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="Dockerfile">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="wwwroot\assets\" />
|
||||
</ItemGroup>
|
||||
|
30
src/Web/WebSPA/package-lock.json
generated
30
src/Web/WebSPA/package-lock.json
generated
@ -9243,15 +9243,6 @@
|
||||
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
|
||||
"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": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
|
||||
@ -9263,6 +9254,15 @@
|
||||
"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": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
|
||||
@ -10085,12 +10085,6 @@
|
||||
"integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=",
|
||||
"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": {
|
||||
"version": "2.1.1",
|
||||
"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": {
|
||||
"version": "0.0.5",
|
||||
"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
|
||||
ARG source
|
||||
FROM microsoft/aspnetcore:2.0 AS base
|
||||
WORKDIR /app
|
||||
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"]
|
||||
|
@ -10,7 +10,8 @@
|
||||
"IdentityUrl": "http://localhost:5105",
|
||||
"ConnectionString": "127.0.0.1",
|
||||
"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.TestHost;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF;
|
||||
using Microsoft.eShopOnContainers.Services.Catalog.API;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.eShopOnContainers.Services.Catalog.API.Infrastructure;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FunctionalTests.Services.Catalog
|
||||
{
|
||||
@ -18,8 +18,23 @@ namespace FunctionalTests.Services.Catalog
|
||||
var webHostBuilder = WebHost.CreateDefaultBuilder();
|
||||
webHostBuilder.UseContentRoot(Directory.GetCurrentDirectory() + "\\Services\\Catalog");
|
||||
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
|
||||
|
@ -4,5 +4,6 @@
|
||||
"IdentityUrl": "http://localhost:5105",
|
||||
"isTest": "true",
|
||||
"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",
|
||||
"IdentityUrl": "http://localhost:5105",
|
||||
"isTest": "true",
|
||||
"EventBusConnection": "localhost"
|
||||
"EventBusConnection": "localhost",
|
||||
"SubscriptionClientName": "Location"
|
||||
}
|
||||
|
@ -3,7 +3,9 @@
|
||||
using Microsoft.AspNetCore;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
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;
|
||||
|
||||
public class MarketingScenariosBase
|
||||
@ -14,9 +16,21 @@
|
||||
{
|
||||
var webHostBuilder = WebHost.CreateDefaultBuilder();
|
||||
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",
|
||||
"AzureServiceBusEnabled": false,
|
||||
"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.Hosting;
|
||||
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 System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace FunctionalTests.Services.Ordering
|
||||
{
|
||||
@ -21,8 +25,22 @@ namespace FunctionalTests.Services.Ordering
|
||||
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
|
||||
|
@ -5,5 +5,6 @@
|
||||
"isTest": "true",
|
||||
"EventBusConnection": "localhost",
|
||||
"CheckUpdateTime": "30000",
|
||||
"GracePeriodTime": "1"
|
||||
"GracePeriodTime": "1",
|
||||
"SubscriptionClientName": "Ordering"
|
||||
}
|
||||
|
@ -10,7 +10,8 @@
|
||||
"IdentityUrl": "http://localhost:5105",
|
||||
"ConnectionString": "127.0.0.1",
|
||||
"isTest": "true",
|
||||
"EventBusConnection": "localhost"
|
||||
"EventBusConnection": "localhost",
|
||||
"SubscriptionClientName": "Basket"
|
||||
}
|
||||
|
||||
|
||||
|
@ -3,7 +3,12 @@
|
||||
using Microsoft.AspNetCore;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.TestHost;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF;
|
||||
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;
|
||||
|
||||
public class CatalogScenarioBase
|
||||
@ -14,7 +19,22 @@
|
||||
webHostBuilder.UseContentRoot(Directory.GetCurrentDirectory() + "\\Services\\Catalog");
|
||||
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
|
||||
|
@ -4,5 +4,6 @@
|
||||
"IdentityUrl": "http://localhost:5105",
|
||||
"isTest": "true",
|
||||
"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",
|
||||
"IdentityUrl": "http://localhost:5105",
|
||||
"isTest": "true",
|
||||
"EventBusConnection": "localhost"
|
||||
"EventBusConnection": "localhost",
|
||||
"SubscriptionClientName": "Locations"
|
||||
}
|
||||
|
@ -3,6 +3,9 @@
|
||||
using Microsoft.AspNetCore;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.TestHost;
|
||||
using Microsoft.eShopOnContainers.Services.Marketing.API.Infrastructure;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System.IO;
|
||||
|
||||
public class MarketingScenarioBase
|
||||
@ -15,7 +18,20 @@
|
||||
webHostBuilder.UseContentRoot(Directory.GetCurrentDirectory() + "\\Services\\Marketing");
|
||||
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",
|
||||
"isTest": "true",
|
||||
"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.TestHost;
|
||||
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.Logging;
|
||||
using Microsoft.Extensions.Options;
|
||||
using System.IO;
|
||||
using Microsoft.eShopOnContainers.BuildingBlocks.IntegrationEventLogEF;
|
||||
|
||||
public class OrderingScenarioBase
|
||||
{
|
||||
@ -19,7 +25,22 @@
|
||||
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
|
||||
|
@ -25,7 +25,7 @@
|
||||
}
|
||||
|
||||
[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())
|
||||
{
|
||||
@ -33,12 +33,12 @@
|
||||
var response = await server.CreateIdempotentClient()
|
||||
.PutAsync(Put.CancelOrder, content);
|
||||
|
||||
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
|
||||
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
|
||||
}
|
||||
}
|
||||
|
||||
[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())
|
||||
{
|
||||
@ -46,7 +46,7 @@
|
||||
var response = await server.CreateIdempotentClient()
|
||||
.PutAsync(Put.ShipOrder, content);
|
||||
|
||||
Assert.Equal(HttpStatusCode.InternalServerError, response.StatusCode);
|
||||
Assert.Equal(HttpStatusCode.BadRequest, response.StatusCode);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -5,5 +5,6 @@
|
||||
"isTest": "true",
|
||||
"EventBusConnection": "localhost",
|
||||
"CheckUpdateTime": "30000",
|
||||
"GracePeriodTime": "1"
|
||||
"GracePeriodTime": "1",
|
||||
"SubscriptionClientName": "Ordering"
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user