Browse Source

Changes for CLI compatibility and New .PDF version

pull/50/head
Cesar De la Torre 8 years ago
parent
commit
9ccf7f11ce
13 changed files with 191 additions and 110 deletions
  1. +114
    -67
      build-bits.ps1
  2. +10
    -10
      docker-compose.override.yml
  3. +14
    -14
      docker-compose.vs.debug.yml
  4. +9
    -9
      docker-compose.vs.release.yml
  5. +8
    -8
      docker-compose.yml
  6. +6
    -0
      src/Services/Basket/Basket.API/Basket.API.csproj
  7. +6
    -0
      src/Services/Catalog/Catalog.API/Catalog.API.csproj
  8. +6
    -0
      src/Services/Identity/Identity.API/Identity.API.csproj
  9. +0
    -1
      src/Services/Identity/Identity.API/wwwroot/js/site.min.js
  10. +6
    -0
      src/Services/Ordering/Ordering.API/Ordering.API.csproj
  11. +6
    -0
      src/Web/WebMVC/WebMVC.csproj
  12. +0
    -1
      src/Web/WebMVC/wwwroot/js/site.min.js
  13. +6
    -0
      src/Web/WebSPA/eShopOnContainers.WebSPA/eShopOnContainers.WebSPA.csproj

+ 114
- 67
build-bits.ps1 View File

@ -2,80 +2,120 @@ $scriptPath = Split-Path $script:MyInvocation.MyCommand.Path
Write-Host "Current script directory is $scriptPath" -ForegroundColor Yellow
$pubFolderToDelete = $scriptPath + "\pub"
remove-item -path $pubFolderToDelete -Force -Recurse -ErrorAction SilentlyContinue
# *** WebMVC paths ***
$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
dotnet restore $webPathToJson
dotnet build $webPathToJson
dotnet publish $webPathToJson -o $webPathToPub
# *** WebSPA image ***
# *** WebSPA paths ***
$webSPAPath = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA"
$webSPAPathToJson = $webSPAPath + "\project.json"
Write-Host "webSPAPathToJson is $webSPAPathToJson" -ForegroundColor Yellow
$webSPAPathToPub = $scriptPath + "\pub\webSPA"
$webSPAPathToProject = $webSPAPath + "\eShopOnContainers.WebSPA.csproj"
Write-Host "webSPAPathToProject is $webSPAPathToProject" -ForegroundColor Yellow
$webSPAPathToPub = $webSPAPath + "\obj\Docker\publish"
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
dotnet restore $webSPAPathToJson
dotnet build $webSPAPathToJson
dotnet publish $webSPAPathToJson -o $webSPAPathToPub
# *** identitySvc image ***
$identitySvcPathToJson = $scriptPath + "\src\Services\Identity\Identity.API\project.json"
Write-Host "identitySvcPathToJson is $identitySvcPathToJson" -ForegroundColor Yellow
$identitySvcPathToPub = $scriptPath + "\pub\identity"
# *** IdentitySvc paths ***
$identitySvcPath = $scriptPath + "\src\Services\Identity\Identity.API"
$identitySvcToProject = $identitySvcPath + "\Identity.API.csproj"
Write-Host "identitySvcToProject is $identitySvcToProject" -ForegroundColor Yellow
$identitySvcPathToPub = $identitySvcPath + "\obj\Docker\publish"
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 ***
$catalogPathToJson = $scriptPath + "\src\Services\Catalog\Catalog.API\project.json"
Write-Host "catalogPathToJson is $catalogPathToJson" -ForegroundColor Yellow
$catalogPathToPub = $scriptPath + "\pub\catalog"
# *** Catalog paths ***
$catalogPath = $scriptPath + "\src\Services\Catalog\Catalog.API"
$catalogPathToProject = $catalogPath + "\Catalog.API.csproj"
Write-Host "catalogPathToProject is $catalogPathToProject" -ForegroundColor Yellow
$catalogPathToPub = $catalogPath + "\obj\Docker\publish"
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 ***
$orderingPath = $scriptPath + "\src\Services\Ordering"
Write-Host "orderingPath is $orderingPath" -ForegroundColor Yellow
$orderingApiPathToJson = $orderingPath + "\Ordering.API\project.json"
Write-Host "orderingApiPathToJson is $orderingApiPathToJson" -ForegroundColor Yellow
$orderingApiPathToPub = $scriptPath + "\pub\ordering"
Write-Host "orderingApiPathToPub is $orderingApiPathToPub" -ForegroundColor Yellow
Write-Host "Restore Dependencies just in case as it is needed to run dotnet publish" -ForegroundColor Blue
dotnet restore $orderingPath
dotnet build $orderingApiPathToJson
dotnet publish $orderingApiPathToJson -o $orderingApiPathToPub
#*** Basket service image ***
$basketPathToJson = $scriptPath + "\src\Services\Basket\Basket.API\project.json"
Write-Host "basketPathToJson is $basketPathToJson" -ForegroundColor Yellow
$basketPathToPub = $scriptPath + "\pub\basket"
# *** Ordering paths ***
$orderingPath = $scriptPath + "\src\Services\Ordering\Ordering.API"
$orderingPathToProject = $orderingPath + "\Ordering.API.csproj"
Write-Host "orderingPathToProject is $orderingPathToProject" -ForegroundColor Yellow
$orderingPathToPub = $orderingPath + "\obj\Docker\publish"
Write-Host "orderingPathToPub is $orderingPathToPub" -ForegroundColor Yellow
# *** Basket paths ***
$basketPath = $scriptPath + "\src\Services\Basket\Basket.API"
$basketPathToProject = $basketPath + "\Basket.API.csproj"
Write-Host "basketPathToProject is $basketPathToProject" -ForegroundColor Yellow
$basketPathToPub = $basketPath + "\obj\Docker\publish"
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
dotnet publish $basketPathToJson -o $basketPathToPub
########################################################################################
# Delete old eShop dotnet publish bits
########################################################################################
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
@ -92,10 +132,17 @@ Else
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 ***
docker build -t eshop/web $webPathToPub
docker build -t eshop/catalog.api $catalogPathToPub
docker build -t eshop/ordering.api $orderingApiPathToPub
docker build -t eshop/basket.api $basketPathToPub
docker build -t eshop/webspa $webSPAPathToPub
docker build -t eshop/identity $identitySvcPathToPub
# docker build -t eshop/web $webPathToPub
# docker build -t eshop/catalog.api $catalogPathToPub
# docker build -t eshop/ordering.api $orderingApiPathToPub
# docker build -t eshop/basket.api $basketPathToPub
# docker build -t eshop/webspa $webSPAPathToPub
# docker build -t eshop/identity $identitySvcPathToPub

+ 10
- 10
docker-compose.override.yml View File

@ -39,16 +39,16 @@ services:
ports:
- "5102:5102"
eshoponcontainers.webspa:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- CatalogUrl=http://10.0.75.1:5101
- 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://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
ports:
- "5104:5104"
# eshoponcontainers.webspa:
# environment:
# - ASPNETCORE_ENVIRONMENT=Development
# - CatalogUrl=http://10.0.75.1:5101
# - 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://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
# ports:
# - "5104:5104"
webmvc:
environment:


+ 14
- 14
docker-compose.vs.debug.yml View File

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


+ 9
- 9
docker-compose.vs.release.yml View File

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


+ 8
- 8
docker-compose.yml View File

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


+ 6
- 0
src/Services/Basket/Basket.API/Basket.API.csproj View File

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

+ 6
- 0
src/Services/Catalog/Catalog.API/Catalog.API.csproj View File

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

+ 6
- 0
src/Services/Identity/Identity.API/Identity.API.csproj View File

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

+ 0
- 1
src/Services/Identity/Identity.API/wwwroot/js/site.min.js View File

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

+ 6
- 0
src/Services/Ordering/Ordering.API/Ordering.API.csproj View File

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

+ 6
- 0
src/Web/WebMVC/WebMVC.csproj View File

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

+ 0
- 1
src/Web/WebMVC/wwwroot/js/site.min.js View File

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

+ 6
- 0
src/Web/WebSPA/eShopOnContainers.WebSPA/eShopOnContainers.WebSPA.csproj View File

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

Loading…
Cancel
Save