-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor PSake File to Perform Deployment in Azure DevOps - Fixes #179 (
#182) * Added support for running integration tests in Azure DevOps * Suppress confirmation of installation of PSDepend module during CI * Prevent AppVeyor CI from executing deploy task * Correct Azure Pipelines Windows build environment variables * Add Publish Artifacts task to Windows Azure Pipeline * Add Publish step to Azure Pipeline CI topublish psakefile * Added missing Changelog entries * Fix Azure Pipelines YAML * Correct YAML again * Added PSDepend File Artifact to Azure Pipeline CI * Added build file artifact * Reworked CI Build Task to Update Git with version number * Correct Artefact PSDepend path * Prepare Release Pipeline * Correct Zip File artefact * Changed Azure DevOps Build Number format * Correct spelling of Name variable * Correct Build Number * Update Module Artefact name in Azure DevOps pipeline * Clean up Deploy Code * Prepare for Deployment * Change Deploy to run in any environment * Add Dignostic Code to PSake * Change build to always publish test results even if failed * Refactor Build Code * Fix Psake File * Change the Deploy Folder that the PSake file picks up * Update the Verbose information in the Deploy * Final Tweak to Deploy Output * Final updates to CHANGELOG.MD
- Loading branch information
Showing
7 changed files
with
260 additions
and
185 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
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,45 +1,42 @@ | ||
[CmdletBinding()] | ||
param ( | ||
[Parameter()] | ||
[Switch] | ||
$Deploy | ||
) | ||
[System.String[]] | ||
$TaskList = 'Default', | ||
|
||
Write-Verbose -Message 'Beginning build process...' | ||
[Parameter()] | ||
[System.Collections.Hashtable] | ||
$Parameters, | ||
|
||
$task = 'Default' | ||
if ($Deploy) | ||
{ | ||
$task = 'Deploy' | ||
} | ||
[Parameter()] | ||
[System.Collections.Hashtable] | ||
$Properties | ||
) | ||
|
||
Write-Verbose -Message ('Beginning ''{0}'' process...' -f ($TaskList -join ',')) | ||
|
||
# Bootstrap the environment | ||
$null = Get-PackageProvider -Name NuGet -ForceBootstrap | ||
|
||
# Install PSDepend module | ||
# Install PSake module if it is not already installed | ||
if (-not (Get-Module -Name PSDepend -ListAvailable)) | ||
{ | ||
$installModuleParameters = @{ | ||
Name = 'PSDepend' | ||
Force = $true | ||
AllowClobber = $true | ||
Repository = 'PSGallery' | ||
} | ||
try | ||
{ | ||
Install-Module @installModuleParameters | ||
} | ||
catch | ||
{ | ||
Install-Module @installModuleParameters -Scope CurrentUser | ||
} | ||
Install-Module -Name PSDepend -Scope CurrentUser -Force -Confirm:$false | ||
} | ||
|
||
# Install all other build dependencies | ||
# Install build dependencies required for Init task | ||
Import-Module -Name PSDepend | ||
Invoke-PSDepend -Path $PSScriptRoot -Force -Import -Install | ||
|
||
Set-BuildEnvironment -Force | ||
|
||
Invoke-Psake -buildFile $ENV:BHProjectPath\psakefile.ps1 -taskList $task -nologo | ||
Invoke-PSDepend ` | ||
-Path $PSScriptRoot ` | ||
-Force ` | ||
-Import ` | ||
-Install ` | ||
-Tags 'Bootstrap' | ||
|
||
# Execute the PSake tasts from the psakefile.ps1 | ||
Invoke-Psake ` | ||
-buildFile (Join-Path -Path $PSScriptRoot -ChildPath 'psakefile.ps1') ` | ||
-nologo ` | ||
@PSBoundParameters | ||
|
||
exit ( [int]( -not $psake.build_success ) ) |
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,67 +1,97 @@ | ||
@{ | ||
psake = @{ | ||
psake = @{ | ||
Name = 'psake' | ||
DependencyType = 'PSGalleryModule' | ||
Parameters = @{ | ||
Repository = 'PSGallery' | ||
SkipPublisherCheck = $true | ||
} | ||
Target = 'CurrentUser' | ||
Version = '4.7.0' | ||
Version = '4.7.4' | ||
Tags = 'Bootstrap' | ||
} | ||
|
||
Pester = @{ | ||
Pester = @{ | ||
Name = 'Pester' | ||
DependencyType = 'PSGalleryModule' | ||
Parameters = @{ | ||
Repository = 'PSGallery' | ||
SkipPublisherCheck = $true | ||
} | ||
Target = 'CurrentUser' | ||
Version = '4.3.1' | ||
Version = '4.4.0' | ||
Tags = 'Test' | ||
} | ||
|
||
PSScriptAnalyzer = @{ | ||
PSScriptAnalyzer = @{ | ||
Name = 'PSScriptAnalyzer' | ||
DependencyType = 'PSGalleryModule' | ||
Parameters = @{ | ||
Repository = 'PSGallery' | ||
SkipPublisherCheck = $true | ||
} | ||
Target = 'CurrentUser' | ||
Version = '1.16.1' | ||
Version = '1.17.1' | ||
Tags = 'Test' | ||
} | ||
|
||
BuildHelpers = @{ | ||
BuildHelpers = @{ | ||
Name = 'BuildHelpers' | ||
DependencyType = 'PSGalleryModule' | ||
Parameters = @{ | ||
Repository = 'PSGallery' | ||
SkipPublisherCheck = $true | ||
} | ||
Target = 'CurrentUser' | ||
Version = '1.0.0' | ||
Version = '2.0.0' | ||
Tags = 'Init' | ||
} | ||
|
||
PSDeploy = @{ | ||
PSDeploy = @{ | ||
Name = 'PSDeploy' | ||
DependencyType = 'PSGalleryModule' | ||
Parameters = @{ | ||
Repository = 'PSGallery' | ||
SkipPublisherCheck = $true | ||
} | ||
Target = 'CurrentUser' | ||
Version = '0.2.3' | ||
Version = '1.0' | ||
Tags = 'Deploy' | ||
} | ||
|
||
Platyps = @{ | ||
Platyps = @{ | ||
Name = 'Platyps' | ||
DependencyType = 'PSGalleryModule' | ||
Parameters = @{ | ||
Repository = 'PSGallery' | ||
SkipPublisherCheck = $true | ||
} | ||
Target = 'CurrentUser' | ||
Version = '0.9.0' | ||
Version = '0.11.1' | ||
Tags = 'Build' | ||
} | ||
|
||
'AzureRM' = @{ | ||
Name = 'AzureRM' | ||
DependencyType = 'PSGalleryModule' | ||
Parameters = @{ | ||
Repository = 'PSGallery' | ||
SkipPublisherCheck = $true | ||
} | ||
Target = 'CurrentUser' | ||
Version = '6.8.1' | ||
Tags = 'Test_Desktop' | ||
} | ||
|
||
'AzureRM.NetCore' = @{ | ||
Name = 'AzureRM.NetCore' | ||
DependencyType = 'PSGalleryModule' | ||
Parameters = @{ | ||
Repository = 'PSGallery' | ||
SkipPublisherCheck = $true | ||
} | ||
Target = 'CurrentUser' | ||
Version = '0.13.1' | ||
Tags = 'Test_Core' | ||
} | ||
} |
Oops, something went wrong.