Changes for CLI compatibility and New .PDF version

This commit is contained in:
Cesar De la Torre 2017-02-16 12:31:53 -08:00
parent 2576c695ad
commit 9ccf7f11ce
13 changed files with 189 additions and 108 deletions

View File

@ -2,80 +2,120 @@ $scriptPath = Split-Path $script:MyInvocation.MyCommand.Path
Write-Host "Current script directory is $scriptPath" -ForegroundColor Yellow Write-Host "Current script directory is $scriptPath" -ForegroundColor Yellow
$pubFolderToDelete = $scriptPath + "\pub" # *** WebMVC paths ***
remove-item -path $pubFolderToDelete -Force -Recurse -ErrorAction SilentlyContinue $webMVCPath = $scriptPath + "\src\Web\WebMVC"
$webMVCPathToProject = $webMVCPath + "\WebMVC.csproj"
Write-Host "webMVCPathToProject is $webMVCPathToProject" -ForegroundColor Yellow
$webMVCPathToPub = $webMVCPath + "\obj\Docker\publish"
Write-Host "webMVCPathToPub is $webMVCPathToPub" -ForegroundColor Yellow
# *** WebMVC image ***
$webPathToJson = $scriptPath + "\src\Web\WebMVC\project.json"
Write-Host "webPathToJson is $webPathToJson" -ForegroundColor Yellow
$webPathToPub = $scriptPath + "\pub\webMVC"
Write-Host "webPathToPub is $webPathToPub" -ForegroundColor Yellow
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue # *** WebSPA paths ***
dotnet restore $webPathToJson
dotnet build $webPathToJson
dotnet publish $webPathToJson -o $webPathToPub
# *** WebSPA image ***
$webSPAPath = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA" $webSPAPath = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA"
$webSPAPathToJson = $webSPAPath + "\project.json" $webSPAPathToProject = $webSPAPath + "\eShopOnContainers.WebSPA.csproj"
Write-Host "webSPAPathToJson is $webSPAPathToJson" -ForegroundColor Yellow Write-Host "webSPAPathToProject is $webSPAPathToProject" -ForegroundColor Yellow
$webSPAPathToPub = $scriptPath + "\pub\webSPA" $webSPAPathToPub = $webSPAPath + "\obj\Docker\publish"
Write-Host "webSPAPathToPub is $webSPAPathToPub" -ForegroundColor Yellow Write-Host "webSPAPathToPub is $webSPAPathToPub" -ForegroundColor Yellow
Write-Host "Installing npm dependencies"
Start-Process -WorkingDirectory $webSPAPath -NoNewWindow -Wait npm i
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue # *** IdentitySvc paths ***
dotnet restore $webSPAPathToJson $identitySvcPath = $scriptPath + "\src\Services\Identity\Identity.API"
dotnet build $webSPAPathToJson $identitySvcToProject = $identitySvcPath + "\Identity.API.csproj"
dotnet publish $webSPAPathToJson -o $webSPAPathToPub Write-Host "identitySvcToProject is $identitySvcToProject" -ForegroundColor Yellow
$identitySvcPathToPub = $identitySvcPath + "\obj\Docker\publish"
# *** identitySvc image ***
$identitySvcPathToJson = $scriptPath + "\src\Services\Identity\Identity.API\project.json"
Write-Host "identitySvcPathToJson is $identitySvcPathToJson" -ForegroundColor Yellow
$identitySvcPathToPub = $scriptPath + "\pub\identity"
Write-Host "identitySvcPathToPub is $identitySvcPathToPub" -ForegroundColor Yellow Write-Host "identitySvcPathToPub is $identitySvcPathToPub" -ForegroundColor Yellow
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
dotnet restore $identitySvcPathToJson
dotnet build $identitySvcPathToJson
dotnet publish $identitySvcPathToJson -o $identitySvcPathToPub
#*** Catalog service image *** # *** Catalog paths ***
$catalogPathToJson = $scriptPath + "\src\Services\Catalog\Catalog.API\project.json" $catalogPath = $scriptPath + "\src\Services\Catalog\Catalog.API"
Write-Host "catalogPathToJson is $catalogPathToJson" -ForegroundColor Yellow $catalogPathToProject = $catalogPath + "\Catalog.API.csproj"
$catalogPathToPub = $scriptPath + "\pub\catalog" Write-Host "catalogPathToProject is $catalogPathToProject" -ForegroundColor Yellow
$catalogPathToPub = $catalogPath + "\obj\Docker\publish"
Write-Host "catalogPathToPub is $catalogPathToPub" -ForegroundColor Yellow Write-Host "catalogPathToPub is $catalogPathToPub" -ForegroundColor Yellow
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
dotnet restore $catalogPathToJson
dotnet build $catalogPathToJson
dotnet publish $catalogPathToJson -o $catalogPathToPub
#*** Ordering service image *** # *** Ordering paths ***
$orderingPath = $scriptPath + "\src\Services\Ordering" $orderingPath = $scriptPath + "\src\Services\Ordering\Ordering.API"
Write-Host "orderingPath is $orderingPath" -ForegroundColor Yellow $orderingPathToProject = $orderingPath + "\Ordering.API.csproj"
$orderingApiPathToJson = $orderingPath + "\Ordering.API\project.json" Write-Host "orderingPathToProject is $orderingPathToProject" -ForegroundColor Yellow
Write-Host "orderingApiPathToJson is $orderingApiPathToJson" -ForegroundColor Yellow $orderingPathToPub = $orderingPath + "\obj\Docker\publish"
$orderingApiPathToPub = $scriptPath + "\pub\ordering" Write-Host "orderingPathToPub is $orderingPathToPub" -ForegroundColor Yellow
Write-Host "orderingApiPathToPub is $orderingApiPathToPub" -ForegroundColor Yellow
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue # *** Basket paths ***
dotnet restore $orderingPath $basketPath = $scriptPath + "\src\Services\Basket\Basket.API"
dotnet build $orderingApiPathToJson $basketPathToProject = $basketPath + "\Basket.API.csproj"
dotnet publish $orderingApiPathToJson -o $orderingApiPathToPub Write-Host "basketPathToProject is $basketPathToProject" -ForegroundColor Yellow
$basketPathToPub = $basketPath + "\obj\Docker\publish"
#*** Basket service image ***
$basketPathToJson = $scriptPath + "\src\Services\Basket\Basket.API\project.json"
Write-Host "basketPathToJson is $basketPathToJson" -ForegroundColor Yellow
$basketPathToPub = $scriptPath + "\pub\basket"
Write-Host "basketPathToPub is $basketPathToPub" -ForegroundColor Yellow Write-Host "basketPathToPub is $basketPathToPub" -ForegroundColor Yellow
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
dotnet restore $basketPathToJson ########################################################################################
dotnet build $basketPathToJson # Delete old eShop dotnet publish bits
dotnet publish $basketPathToJson -o $basketPathToPub ########################################################################################
Write-Host "Deleting previous dotnet publish bits from all projects" -ForegroundColor Blue
remove-item -path $WebMVCPathToPub -Force -Recurse -ErrorAction SilentlyContinue
remove-item -path $webSPAPathToPub -Force -Recurse -ErrorAction SilentlyContinue
remove-item -path $identitySvcPathToPub -Force -Recurse -ErrorAction SilentlyContinue
remove-item -path $catalogPathToPub -Force -Recurse -ErrorAction SilentlyContinue
remove-item -path $orderingPathToPub -Force -Recurse -ErrorAction SilentlyContinue
remove-item -path $basketPathToPub -Force -Recurse -ErrorAction SilentlyContinue
########################################################################################
# Building DotNet bits
########################################################################################
# WebMVC: Build dotnet bits
Write-Host "WebMVC: Restore Dependencies, dotnet build and dotnet publish" -ForegroundColor Blue
dotnet restore $WebMVCPathToProject
dotnet build $WebMVCPathToProject
dotnet publish $WebMVCPathToProject -o $WebMVCPathToPub
# WebSPA: Build dotnet bits
Write-Host "WebSPA: Installing npm dependencies"
#TEMP COMMENT--- Start-Process -WorkingDirectory $webSPAPath -NoNewWindow -Wait npm i
Write-Host "WebSPA: Restore Dependencies, dotnet build and dotnet publish" -ForegroundColor Blue
dotnet restore $webSPAPathToProject
dotnet build $webSPAPathToProject
dotnet publish $webSPAPathToProject -o $webSPAPathToPub
# Identity Service: Build dotnet bits
Write-Host "Identity Service: Restore Dependencies, dotnet build and dotnet publish" -ForegroundColor Blue
dotnet restore $identitySvcToProject
dotnet build $identitySvcToProject
dotnet publish $identitySvcToProject -o $identitySvcPathToPub
# Catalog Service: Build dotnet bits
Write-Host "Catalog Service: Restore Dependencies, dotnet build and dotnet publish" -ForegroundColor Blue
dotnet restore $catalogPathToProject
dotnet build $catalogPathToProject
dotnet publish $catalogPathToProject -o $catalogPathToPub
# Ordering Service: Build dotnet bits
Write-Host "Ordering Service: Restore Dependencies, dotnet build and dotnet publish" -ForegroundColor Blue
dotnet restore $orderingPathToProject
dotnet build $orderingPathToProject
dotnet publish $orderingPathToProject -o $orderingPathToPub
# Basket Service: Build dotnet bits
Write-Host "Basket Service: Restore Dependencies, dotnet build and dotnet publish" -ForegroundColor Blue
dotnet restore $basketPathToProject
dotnet build $basketPathToProject
dotnet publish $basketPathToProject -o $basketPathToPub
########################################################################################
# Delete old eShop Docker images
########################################################################################
$imagesToDelete = docker images --filter=reference="eshop/*" -q $imagesToDelete = docker images --filter=reference="eshop/*" -q
@ -92,10 +132,17 @@ Else
docker rmi $(docker images --filter=reference="eshop/*" -q) -f docker rmi $(docker images --filter=reference="eshop/*" -q) -f
} }
########################################################################################
# Build new eShop images
########################################################################################
# WE DON'T NEED DOCKER BUILD AS WE CAN RUN "DOCKER-COMPOSE BUILD" OR "DOCKER-COMPOSE UP" AND IT WILL BUILD ALL THE IMAGES IN THE .YML FOR US
#*** build docker images *** #*** build docker images ***
docker build -t eshop/web $webPathToPub # docker build -t eshop/web $webPathToPub
docker build -t eshop/catalog.api $catalogPathToPub # docker build -t eshop/catalog.api $catalogPathToPub
docker build -t eshop/ordering.api $orderingApiPathToPub # docker build -t eshop/ordering.api $orderingApiPathToPub
docker build -t eshop/basket.api $basketPathToPub # docker build -t eshop/basket.api $basketPathToPub
docker build -t eshop/webspa $webSPAPathToPub # docker build -t eshop/webspa $webSPAPathToPub
docker build -t eshop/identity $identitySvcPathToPub # docker build -t eshop/identity $identitySvcPathToPub

View File

@ -39,16 +39,16 @@ services:
ports: ports:
- "5102:5102" - "5102:5102"
eshoponcontainers.webspa: # eshoponcontainers.webspa:
environment: # environment:
- ASPNETCORE_ENVIRONMENT=Development # - ASPNETCORE_ENVIRONMENT=Development
- CatalogUrl=http://10.0.75.1:5101 # - CatalogUrl=http://10.0.75.1:5101
- OrderingUrl=http://10.0.75.1:5102 # - OrderingUrl=http://10.0.75.1:5102
#- IdentityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105. # #- IdentityUrl=http://13.88.8.119:5105 #Remote: VM Needs to have public access at 5105.
- IdentityUrl=http://10.0.75.1:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105. # - IdentityUrl=http://10.0.75.1:5105 #Local: You need to open your local dev-machine firewall at range 5100-5105. at range 5100-5105.
- BasketUrl=http://10.0.75.1:5103 # - BasketUrl=http://10.0.75.1:5103
ports: # ports:
- "5104:5104" # - "5104:5104"
webmvc: webmvc:
environment: environment:

View File

@ -61,20 +61,20 @@ services:
labels: labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux" - "com.microsoft.visualstudio.targetoperatingsystem=linux"
eshoponcontainers.webspa: # eshoponcontainers.webspa:
image: eshop/eshoponcontainers.webspa:dev # image: eshop/eshoponcontainers.webspa:dev
build: # build:
args: # args:
source: ${DOCKER_BUILD_SOURCE} # source: ${DOCKER_BUILD_SOURCE}
environment: # environment:
- DOTNET_USE_POLLING_FILE_WATCHER=1 # - DOTNET_USE_POLLING_FILE_WATCHER=1
volumes: # volumes:
- ./src/Web/WebSPA/eShopOnContainers.WebSPA:/app # - ./src/Web/WebSPA/eShopOnContainers.WebSPA:/app
- ~/.nuget/packages:/root/.nuget/packages:ro # - ~/.nuget/packages:/root/.nuget/packages:ro
- ~/clrdbg:/clrdbg:ro # - ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null # entrypoint: tail -f /dev/null
labels: # labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux" # - "com.microsoft.visualstudio.targetoperatingsystem=linux"
webmvc: webmvc:
image: eshop/webmvc:dev image: eshop/webmvc:dev

View File

@ -41,15 +41,15 @@ services:
labels: labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux" - "com.microsoft.visualstudio.targetoperatingsystem=linux"
eshoponcontainers.webspa: # eshoponcontainers.webspa:
build: # build:
args: # args:
source: ${DOCKER_BUILD_SOURCE} # source: ${DOCKER_BUILD_SOURCE}
volumes: # volumes:
- ~/clrdbg:/clrdbg:ro # - ~/clrdbg:/clrdbg:ro
entrypoint: tail -f /dev/null # entrypoint: tail -f /dev/null
labels: # labels:
- "com.microsoft.visualstudio.targetoperatingsystem=linux" # - "com.microsoft.visualstudio.targetoperatingsystem=linux"
webmvc: webmvc:
build: build:

View File

@ -34,14 +34,14 @@ services:
depends_on: depends_on:
- sql.data - sql.data
eshoponcontainers.webspa: # eshoponcontainers.webspa:
image: eshop/eshoponcontainers.webspa # image: eshop/eshoponcontainers.webspa
build: # build:
context: ./src/Web/WebSPA/eShopOnContainers.WebSPA # context: ./src/Web/WebSPA/eShopOnContainers.WebSPA
dockerfile: Dockerfile # dockerfile: Dockerfile
depends_on: # depends_on:
- identity.api # - identity.api
- basket.api # - basket.api
webmvc: webmvc:
image: eshop/webmvc image: eshop/webmvc

View File

@ -36,4 +36,10 @@
<PackageReference Include="Swashbuckle" Version="6.0.0-beta902" /> <PackageReference Include="Swashbuckle" Version="6.0.0-beta902" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Update="Dockerfile">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project> </Project>

View File

@ -44,4 +44,10 @@
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.0-msbuild3-final" /> <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.0.0-msbuild3-final" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Update="Dockerfile">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project> </Project>

View File

@ -63,4 +63,10 @@
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0-msbuild3-final" /> <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0-msbuild3-final" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Update="Dockerfile">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project> </Project>

View File

@ -1 +0,0 @@
// Write your Javascript code.

View File

@ -54,4 +54,10 @@
<DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.1.0-preview4-final" /> <DotNetCliToolReference Include="Microsoft.EntityFrameworkCore.Tools.DotNet" Version="1.1.0-preview4-final" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Update="Dockerfile">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project> </Project>

View File

@ -56,4 +56,10 @@
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0-msbuild3-final" /> <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0-msbuild3-final" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Update="Dockerfile">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project> </Project>

View File

@ -1 +0,0 @@
// Write your Javascript code.

View File

@ -57,4 +57,10 @@
<DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0-msbuild3-final" /> <DotNetCliToolReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Tools" Version="1.0.0-msbuild3-final" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<None Update="Dockerfile">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project> </Project>