Skip to content

Commit

Permalink
Upgrade to RC2 and hands on lab updates (#78)
Browse files Browse the repository at this point in the history
* 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
shadtimm authored and dtzar committed Jul 12, 2016
1 parent cc2c5e9 commit 7903c98
Show file tree
Hide file tree
Showing 136 changed files with 1,878 additions and 493 deletions.
2 changes: 1 addition & 1 deletion NuGet.Config
Expand Up @@ -3,6 +3,6 @@
<packageSources>
<clear />
<add key="NuGet" value="https://api.nuget.org/v3/index.json" />
<add key="AspNetVNext" value="https://www.myget.org/f/aspnetmaster/api/v3/index.json" />
<add key="Microsoft and .NET" value="https://www.nuget.org/api/v2/curated-feeds/microsoftdotnet/" />
</packageSources>
</configuration>
36 changes: 18 additions & 18 deletions PartsUnlimited.sln
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.22806.0
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{44621553-AA7D-4893-8834-79582A7D8348}"
EndProject
Expand All @@ -13,13 +13,13 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B7B176B6-8D4D-4EF1-BBD2-DDA650C78FFF}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{363D2681-31A6-48C9-90BB-9ACFF4A41F06}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "PartsUnlimitedWebsite", "src\PartsUnlimitedWebsite\PartsUnlimitedWebsite.xproj", "{3CFBED5D-2ED8-49DB-96FB-BDAA748DC5A0}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "PartsUnlimited", "src\PartsUnlimitedWebsite\PartsUnlimited.xproj", "{3CFBED5D-2ED8-49DB-96FB-BDAA748DC5A0}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "PartsUnlimited.Models", "src\PartsUnlimited.Models\PartsUnlimited.Models.xproj", "{AF7CC9D8-E786-472B-85CD-8EE5E7429D25}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "PartsUnlimited.UnitTests", "test\PartsUnlimited.UnitTests\PartsUnlimited.UnitTests.xproj", "{0C64E1A0-7791-457B-BD8A-60CBA4979702}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{024D69BE-CCBC-4C2C-9D50-9AC33D2645FE}"
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "PartsUnlimited.Models", "src\PartsUnlimited.Models\PartsUnlimited.Models.xproj", "{AF7CC9D8-E786-472B-85CD-8EE5E7429D25}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "PartsUnlimited.UnitTests", "test\PartsUnlimited.UnitTests\PartsUnlimited.UnitTests.xproj", "{0C64E1A0-7791-457B-BD8A-60CBA4979702}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -41,18 +41,6 @@ Global
{3CFBED5D-2ED8-49DB-96FB-BDAA748DC5A0}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{3CFBED5D-2ED8-49DB-96FB-BDAA748DC5A0}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{3CFBED5D-2ED8-49DB-96FB-BDAA748DC5A0}.Release|x86.ActiveCfg = Release|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Debug|x86.ActiveCfg = Debug|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Debug|x86.Build.0 = Debug|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Release|Any CPU.Build.0 = Release|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Release|x86.ActiveCfg = Release|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Release|x86.Build.0 = Release|Any CPU
{AF7CC9D8-E786-472B-85CD-8EE5E7429D25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AF7CC9D8-E786-472B-85CD-8EE5E7429D25}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AF7CC9D8-E786-472B-85CD-8EE5E7429D25}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
Expand All @@ -65,13 +53,25 @@ Global
{AF7CC9D8-E786-472B-85CD-8EE5E7429D25}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{AF7CC9D8-E786-472B-85CD-8EE5E7429D25}.Release|x86.ActiveCfg = Release|Any CPU
{AF7CC9D8-E786-472B-85CD-8EE5E7429D25}.Release|x86.Build.0 = Release|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Debug|x86.ActiveCfg = Debug|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Debug|x86.Build.0 = Debug|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Release|Any CPU.Build.0 = Release|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Release|x86.ActiveCfg = Release|Any CPU
{0C64E1A0-7791-457B-BD8A-60CBA4979702}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{3CFBED5D-2ED8-49DB-96FB-BDAA748DC5A0} = {B7B176B6-8D4D-4EF1-BBD2-DDA650C78FFF}
{0C64E1A0-7791-457B-BD8A-60CBA4979702} = {363D2681-31A6-48C9-90BB-9ACFF4A41F06}
{AF7CC9D8-E786-472B-85CD-8EE5E7429D25} = {B7B176B6-8D4D-4EF1-BBD2-DDA650C78FFF}
{0C64E1A0-7791-457B-BD8A-60CBA4979702} = {024D69BE-CCBC-4C2C-9D50-9AC33D2645FE}
EndGlobalSection
EndGlobal
44 changes: 35 additions & 9 deletions build.ps1
@@ -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"

0 comments on commit 7903c98

Please sign in to comment.