Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to RC2 and hands on lab updates (#78)
* Initial changes for DotNetCore RC2 from [Elizabeth Maher](https://github.com/EMaher) * Migrating PartsUnlimited.Models to dnxcore5.0 https://github.com/EMaher/PartsUnlimited/tree/emaher/upgradeToRc2 https://github.com/EMaher/PartsUnlimited/commit/780b0b0919e1838fe91e6659fc70ae080bc2e189 * Initial project.json changes to get dotnet restore functional * WebJobs SDK does not support DotNetCore and both web jobs have a shared dependency on PartsUnlimited.Models. This fixes dotnet restore errors but the WebJobs still have broken dependencies * Changes to website project.json to get npm and grunt functional - postrestore and prepare are no longer valid with RC2 so dotnet build was not executing these * Updates to build.ps1 file to easily build from a VSTS build - This build file handles restore, build, test, publish and production of a valid MSDeploy zip package to make deployment through out of the box VSTS RM tasks easier * Adding missing ARM template which is used in the hands on labs * Updates to CI and CD hands on labs * Updating links and references to labs
- Loading branch information
Showing
136 changed files
with
1,878 additions
and
493 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,43 @@ | ||
[CmdletBinding()] | ||
Param( | ||
[Parameter(Mandatory=$True)] [string] $BuildConfiguration | ||
[Parameter(Mandatory=$True)] [string] $BuildConfiguration, | ||
[Parameter(Mandatory=$True)] [string] $BuildStagingDirectory | ||
) | ||
|
||
#Install dnvm | ||
& scripts/Install-Dnvm.ps1 | ||
$ErrorActionPreference = "Stop" | ||
|
||
# Restore and build projects | ||
& scripts/Call-Dnu.ps1 restore .\src | ||
& scripts/Call-Dnu.ps1 build .\src\PartsUnlimitedWebsite --configuration $BuildConfiguration | ||
|
||
& scripts/Call-Dnu.ps1 restore .\test | ||
& scripts/Call-Dnu.ps1 build .\test\PartsUnlimited.UnitTests --configuration $BuildConfiguration | ||
& dotnet restore | ||
& dotnet build .\src\PartsUnlimitedWebsite --configuration $BuildConfiguration | ||
& dotnet build .\test\PartsUnlimited.UnitTests --configuration $BuildConfiguration | ||
|
||
# Run tests | ||
& scripts/Call-Dnx.ps1 -p .\test\PartsUnlimited.UnitTests test -xml testresults.xml | ||
& dotnet test .\test\PartsUnlimited.UnitTests -xml testresults.xml | ||
|
||
# Publish | ||
$publishDirectory = Join-Path $BuildStagingDirectory "Publish" | ||
$outputDirectory = Join-Path $publishDirectory "PartsUnlimited" | ||
& dotnet publish .\src\PartsUnlimitedWebsite --framework netcoreapp1.0 --output $outputDirectory --configuration $BuildConfiguration --no-build | ||
|
||
# Package to MSDeploy format | ||
$manifestFile = Join-Path $publishDirectory "manifest.xml" | ||
$sourceManifest = @' | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<sitemanifest MSDeploy.ObjectResolver.createApp="Microsoft.Web.Deployment.CreateApplicationObjectResolver" MSDeploy.ObjectResolver.dirPath="Microsoft.Web.Depl | ||
oyment.DirPathObjectResolver" MSDeploy.ObjectResolver.filePath="Microsoft.Web.Deployment.FilePathObjectResolver"> | ||
<iisApp path="PATH_TO_REPLACE"> | ||
<createApp path="PATH_TO_REPLACE" MSDeploy.path="2" isDest="AA==" MSDeploy.isDest.Type="Microsoft.Web.Deployment.DeploymentObjectBooleanAttributeValue" managedRuntimeVersion="" MSDeploy.managedRuntimeVersion="2" enable32BitAppOnWin64="" MSDeploy.enable32BitAppOnWin64="2" managedPipelineMode="" MSDeploy.managedPipelineMode="2" applicationPool="" MSDeploy.applicationPool="1" appExists="True" MSDeploy.appExists="1" MSDeploy.MSDeployLinkName="createApp" MSDeploy.MSDeployKeyAttributeName="path" /> | ||
<contentPath path="PATH_TO_REPLACE" MSDeploy.path="2" MSDeploy.MSDeployLinkName="contentPath"> | ||
<MSDeploy.dirPath path="PATH_TO_REPLACE" MSDeploy.MSDeployLinkName="contentPath" /> | ||
</contentPath> | ||
</iisApp> | ||
</sitemanifest> | ||
'@ | ||
$sourceManifest = $sourceManifest.Replace('PATH_TO_REPLACE',$outputDirectory) | ||
Set-Content -Path $manifestFile -Value $sourceManifest | ||
|
||
$destinationFile = Join-Path $BuildStagingDirectory "partsunlimited.zip" | ||
|
||
$regexOutputDirectory = $outputDirectory.Replace('\','\\') | ||
|
||
Invoke-Expression "& 'C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe' --% -verb:sync -source:manifest=`'$manifestFile`' -dest:package=`'$destinationFile`' -declareParam:name='IIS Web Application Name',kind=ProviderPath,scope=IisApp,match=^$regexOutputDirectory,defaultValue='Default Web Site/site1',tags=IisApp -declareParam:name='IIS Web Application Name',kind=ProviderPath,scope=setAcl,match=^$regexOutputDirectory,tags=IisApp" |
Oops, something went wrong.