From dc1a245720046598f51df88e99b2e6b7b818a864 Mon Sep 17 00:00:00 2001 From: Cesar De la Torre Date: Thu, 16 Feb 2017 13:59:40 -0800 Subject: [PATCH] Cleaning the old build-image.ps1 files up as the Docker Images are build now with docker-compose build/up and the PowerShell Scrip "build-bits.ps1" just needs to build the .NET and SPA bits and publish it into each pub directory per project. --- build-images.sh => build-bits.sh | 0 build-image-service-basket.ps1 | 16 ----- build-image-service-catalog.ps1 | 16 ----- build-image-service-identity.ps1 | 16 ----- build-image-service-orders.ps1 | 18 ------ build-image-web-spa.ps1 | 80 ------------------------ build-image-web.ps1 | 76 ----------------------- build-images.ps1 | 101 ------------------------------- 8 files changed, 323 deletions(-) rename build-images.sh => build-bits.sh (100%) delete mode 100644 build-image-service-basket.ps1 delete mode 100644 build-image-service-catalog.ps1 delete mode 100644 build-image-service-identity.ps1 delete mode 100644 build-image-service-orders.ps1 delete mode 100644 build-image-web-spa.ps1 delete mode 100644 build-image-web.ps1 delete mode 100644 build-images.ps1 diff --git a/build-images.sh b/build-bits.sh similarity index 100% rename from build-images.sh rename to build-bits.sh diff --git a/build-image-service-basket.ps1 b/build-image-service-basket.ps1 deleted file mode 100644 index 8294f4625..000000000 --- a/build-image-service-basket.ps1 +++ /dev/null @@ -1,16 +0,0 @@ -$scriptPath = Split-Path $script:MyInvocation.MyCommand.Path - -Write-Host "Current script directory is $scriptPath" -ForegroundColor Yellow - -#*** 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 "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 - -docker build -t eshop/basket.api $basketPathToPub \ No newline at end of file diff --git a/build-image-service-catalog.ps1 b/build-image-service-catalog.ps1 deleted file mode 100644 index 7612e4f59..000000000 --- a/build-image-service-catalog.ps1 +++ /dev/null @@ -1,16 +0,0 @@ -$scriptPath = Split-Path $script:MyInvocation.MyCommand.Path - -Write-Host "Current script directory is $scriptPath" -ForegroundColor Yellow - -#*** Catalog service image *** -$catalogPathToJson = $scriptPath + "\src\Services\Catalog\Catalog.API\project.json" -Write-Host "catalogPathToJson is $catalogPathToJson" -ForegroundColor Yellow -$catalogPathToPub = $scriptPath + "\pub\catalog" -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 - -docker build -t eshop/catalog.api $catalogPathToPub \ No newline at end of file diff --git a/build-image-service-identity.ps1 b/build-image-service-identity.ps1 deleted file mode 100644 index 00c8d0076..000000000 --- a/build-image-service-identity.ps1 +++ /dev/null @@ -1,16 +0,0 @@ -$scriptPath = Split-Path $script:MyInvocation.MyCommand.Path - -Write-Host "Current script directory is $scriptPath" -ForegroundColor Yellow - -# *** identitySvc image *** -$identitySvcPathToJson = $scriptPath + "\src\Services\Identity\eShopOnContainers.Identity\project.json" -Write-Host "identitySvcPathToJson is $identitySvcPathToJson" -ForegroundColor Yellow -$identitySvcPathToPub = $scriptPath + "\pub\identity" -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 - -docker build -t eshop/identity $identitySvcPathToPub \ No newline at end of file diff --git a/build-image-service-orders.ps1 b/build-image-service-orders.ps1 deleted file mode 100644 index 3e2137f8f..000000000 --- a/build-image-service-orders.ps1 +++ /dev/null @@ -1,18 +0,0 @@ -$scriptPath = Split-Path $script:MyInvocation.MyCommand.Path - -Write-Host "Current script directory is $scriptPath" -ForegroundColor Yellow - -#*** 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 - -docker build -t eshop/ordering.api $orderingPathToPub \ No newline at end of file diff --git a/build-image-web-spa.ps1 b/build-image-web-spa.ps1 deleted file mode 100644 index ccecc0d36..000000000 --- a/build-image-web-spa.ps1 +++ /dev/null @@ -1,80 +0,0 @@ -$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 - -# *** WebSPA image *** -$webSPAPath = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA" -$webSPAPathToJson = $webSPAPath + "\project.json" -Write-Host "webSPAPathToJson is $webSPAPathToJson" -ForegroundColor Yellow -$webSPAPathToPub = $scriptPath + "\pub\webSPA" -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" -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" -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" -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 all eshop containers -docker rm $(docker images --filter=reference="eshop/*" -q) -f -# Delete all eshop images -docker rmi $(docker images --filter=reference="eshop/*" -q) - -#*** build docker images *** -docker build -t eshop/catalog.api $catalogPathToPub -docker build -t eshop/ordering.api $orderingPathToPub -docker build -t eshop/basket.api $basketPathToPub -docker build -t eshop/webspa $webSPAPathToPub -docker build -t eshop/identity $identitySvcPathToPub \ No newline at end of file diff --git a/build-image-web.ps1 b/build-image-web.ps1 deleted file mode 100644 index e64711523..000000000 --- a/build-image-web.ps1 +++ /dev/null @@ -1,76 +0,0 @@ -$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 -#cmd /c "rd /s pub" /q - -# *** 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 - -# *** identitySvc image *** -$identitySvcPathToJson = $scriptPath + "\src\Services\Identity\eShopOnContainers.Identity\project.json" -Write-Host "identitySvcPathToJson is $identitySvcPathToJson" -ForegroundColor Yellow -$identitySvcPathToPub = $scriptPath + "\pub\identity" -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" -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" -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 all eshop containers -docker rm $(docker images --filter=reference="eshop/*" -q) -f -# Delete all eshop images -docker rmi $(docker images --filter=reference="eshop/*" -q) - -#*** build docker images *** -docker build -t eshop/web $webPathToPub -docker build -t eshop/catalog.api $catalogPathToPub -docker build -t eshop/ordering.api $orderingPathToPub -docker build -t eshop/basket.api $basketPathToPub -docker build -t eshop/identity $identitySvcPathToPub \ No newline at end of file diff --git a/build-images.ps1 b/build-images.ps1 deleted file mode 100644 index 3a33a6ee7..000000000 --- a/build-images.ps1 +++ /dev/null @@ -1,101 +0,0 @@ -$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 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 *** -$webSPAPath = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA" -$webSPAPathToJson = $webSPAPath + "\project.json" -Write-Host "webSPAPathToJson is $webSPAPathToJson" -ForegroundColor Yellow -$webSPAPathToPub = $scriptPath + "\pub\webSPA" -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" -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" -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" -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 - -$imagesToDelete = docker images --filter=reference="eshop/*" -q - -If (-Not $imagesToDelete) {Write-Host "Not deleting eShop images as there are no eShop images in the current local Docker repo."} -Else -{ - # Delete all containers - Write-Host "Deleting all containers in local Docker Host" - docker rm $(docker ps -a -q) -f - - # Delete all eshop images - Write-Host "Deleting eShop images in local Docker repo" - Write-Host $imagesToDelete - docker rmi $(docker images --filter=reference="eshop/*" -q) -f -} - -#*** 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 \ No newline at end of file