Building Out Build Items
This commit is contained in:
@@ -0,0 +1,50 @@
|
|||||||
|
@{
|
||||||
|
psake = @{
|
||||||
|
Name = 'InvokeBuild'
|
||||||
|
DependencyType = 'PSGalleryModule'
|
||||||
|
Parameters = @{
|
||||||
|
Repository = 'PSGallery'
|
||||||
|
SkipPublisherCheck = $true
|
||||||
|
}
|
||||||
|
Target = 'CurrentUser'
|
||||||
|
Version = '5.4.3'
|
||||||
|
Tags = 'Bootstrap'
|
||||||
|
}
|
||||||
|
|
||||||
|
Pester = @{
|
||||||
|
Name = 'Pester'
|
||||||
|
DependencyType = 'PSGalleryModule'
|
||||||
|
Parameters = @{
|
||||||
|
Repository = 'PSGallery'
|
||||||
|
SkipPublisherCheck = $true
|
||||||
|
}
|
||||||
|
Target = 'CurrentUser'
|
||||||
|
Version = '4.6.0'
|
||||||
|
Tags = 'Test'
|
||||||
|
}
|
||||||
|
|
||||||
|
PSScriptAnalyzer = @{
|
||||||
|
Name = 'PSScriptAnalyzer'
|
||||||
|
DependencyType = 'PSGalleryModule'
|
||||||
|
Parameters = @{
|
||||||
|
Repository = 'PSGallery'
|
||||||
|
SkipPublisherCheck = $true
|
||||||
|
}
|
||||||
|
Target = 'CurrentUser'
|
||||||
|
Version = '1.17.1'
|
||||||
|
Tags = 'Test'
|
||||||
|
}
|
||||||
|
|
||||||
|
Platyps = @{
|
||||||
|
Name = 'Platyps'
|
||||||
|
DependencyType = 'PSGalleryModule'
|
||||||
|
Parameters = @{
|
||||||
|
Repository = 'PSGallery'
|
||||||
|
SkipPublisherCheck = $true
|
||||||
|
}
|
||||||
|
Target = 'CurrentUser'
|
||||||
|
Version = '0.12.0'
|
||||||
|
Tags = 'Build'
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,17 +1,44 @@
|
|||||||
task . InstallDependencies, Analyze
|
#Requires -Modules 'InvokeBuild'
|
||||||
|
|
||||||
task InstallDependencies {
|
. '.\ZertoApiWrapper.settings.ps1'
|
||||||
Install-Module Pester -Force
|
# import-module "$BuildRoot\ZertoApiWrapper\ZertoApiWrapper.psd1" -Verbose -Force
|
||||||
Install-Module PSScriptAnalyzer -Force
|
|
||||||
|
<# [CmdletBinding()]
|
||||||
|
param([switch]$Install,
|
||||||
|
[string]$Configuration = (property Configuration Release))
|
||||||
|
$targetDir = "temp/$Configuration/ZertoApiWrapper" #>
|
||||||
|
|
||||||
|
task . Analyze, FileTests
|
||||||
|
|
||||||
|
<# Synopsis: Ensure platyPS is installed #>
|
||||||
|
task CheckPlatyPSInstalled {
|
||||||
|
if ($null -eq (Get-Module -List platyPS)) {
|
||||||
|
Install-Module -Scope CurrentUser -Repository PSGallery -Name platyPS
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task Analyze {
|
<# Synopsis: Ensure Pester is installed #>
|
||||||
|
task CheckPesterInstalled {
|
||||||
|
if ($null -eq (Get-Module -List Pester)) {
|
||||||
|
Install-Module -Scope CurrentUser -Repository PSGallery -Name Pester
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<# Synopsis: Ensure PSScriptAnalyzer is installed #>
|
||||||
|
task CheckPSScriptAnalyzerInstalled {
|
||||||
|
if ($null -eq (Get-Module -List PSScriptAnalyzer)) {
|
||||||
|
Install-Module -Scope CurrentUser -Repository PSGallery -Name PSScriptAnalyzer
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
<# Synopsis: Analyze ZertoApiWrapper functions for Code Violations #>
|
||||||
|
task Analyze CheckPSScriptAnalyzerInstalled, CheckPesterInstalled, CheckPlatyPSInstalled, {
|
||||||
$scriptAnalyzerParams = @{
|
$scriptAnalyzerParams = @{
|
||||||
Path = "$BuildRoot\ZertoApiWrapper\"
|
Path = "$BuildRoot\ZertoApiWrapper\"
|
||||||
Severity = @('Error', 'Warning')
|
Severity = @('Error', 'Warning')
|
||||||
Recurse = $true
|
Recurse = $true
|
||||||
Verbose = $false
|
Verbose = $false
|
||||||
ExcludeRule = 'PSUseDeclaredVarsMoreThanAssignments'
|
ExcludeRule = @('PSUseDeclaredVarsMoreThanAssignments', 'PSUseShouldProcessForStateChangingFunctions')
|
||||||
}
|
}
|
||||||
$saresults = Invoke-ScriptAnalyzer @scriptAnalyzerParams
|
$saresults = Invoke-ScriptAnalyzer @scriptAnalyzerParams
|
||||||
|
|
||||||
@@ -21,3 +48,6 @@ task Analyze {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task FileTests CheckPesterInstalled, {
|
||||||
|
Invoke-Pester "$BuildRoot\Tests\Public\ZertoApiWrapper.Tests.ps1" -Show Fails
|
||||||
|
}
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
# Bootstrap the environment
|
||||||
|
$null = Get-PackageProvider -Name NuGet -ForceBootstrap
|
||||||
|
|
||||||
|
if (-not (Get-Module -Name PSDepend -ListAvailable)) {
|
||||||
|
Install-Module -Name PSDepend -Scope CurrentUser -Force -Confirm:$false
|
||||||
|
}
|
||||||
|
|
||||||
|
Import-Module -Name PSDepend
|
||||||
|
Invoke-PSDepend `
|
||||||
|
-Path $PSScriptRoot `
|
||||||
|
-Force `
|
||||||
|
-Import `
|
||||||
|
-Install `
|
||||||
|
-Tags 'Bootstrap'
|
||||||
|
|
||||||
|
Invoke-Build .
|
||||||
Reference in New Issue
Block a user