From 0cd8ccf54bc8e64609b26fe58ee9d52aebd021ac Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Mon, 13 Feb 2017 12:55:34 -0800 Subject: [PATCH] Install WebSPA's npm dependencies before building --- build-image-web-spa.ps1 | 8 +++++--- build-images.ps1 | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/build-image-web-spa.ps1 b/build-image-web-spa.ps1 index 548a5aaed..deee445d1 100644 --- a/build-image-web-spa.ps1 +++ b/build-image-web-spa.ps1 @@ -6,16 +6,18 @@ $pubFolderToDelete = $scriptPath + "\pub" remove-item -path $pubFolderToDelete -Force -Recurse -ErrorAction SilentlyContinue # *** WebSPA image *** -$webSPAPathToJson = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA\project.json" +$webSPAPath = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA" +$webSPAPathToJson = $webSPAPath + "\project.json" Write-Host "webSPAPathToJson is $webSPAPathToJson" -ForegroundColor Yellow $webSPAPathToPub = $scriptPath + "\pub\webSPA" -$webSPAPathToNpmBat = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA\buildspa.bat" 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 -# Start-Process "cmd.exe" "/c " + $webSPAPathToNpmBat dotnet publish $webSPAPathToJson -o $webSPAPathToPub # *** identitySvc image *** diff --git a/build-images.ps1 b/build-images.ps1 index 54d928bf2..c10df08ed 100644 --- a/build-images.ps1 +++ b/build-images.ps1 @@ -17,16 +17,18 @@ dotnet build $webPathToJson dotnet publish $webPathToJson -o $webPathToPub # *** WebSPA image *** -$webSPAPathToJson = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA\project.json" +$webSPAPath = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA" +$webSPAPathToJson = $webSPAPath + "\project.json" Write-Host "webSPAPathToJson is $webSPAPathToJson" -ForegroundColor Yellow $webSPAPathToPub = $scriptPath + "\pub\webSPA" -$webSPAPathToNpmBat = $scriptPath + "\src\Web\WebSPA\eShopOnContainers.WebSPA\buildspa.bat" 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 -# Start-Process "cmd.exe" "/c " + $webSPAPathToNpmBat dotnet publish $webSPAPathToJson -o $webSPAPathToPub # *** identitySvc image ***