Skip to content
This repository has been archived by the owner on Oct 21, 2023. It is now read-only.

Commit

Permalink
updates to 2.10.0
Browse files Browse the repository at this point in the history
## 2.10.0.X - 2020-02-18

* **Brought minimum .NET version to 4.7.2**
* Updated build process to use InvokeBuild instead of psake
* Updated tasks to pull down the latest dependent assemblies during build
* Added scheduled build triggers for weekly deployments
* Changed the version scheme so it includes the date stamp as the build version
  • Loading branch information
scrthq committed Feb 18, 2020
1 parent 9d4ed79 commit 9bb5f29
Show file tree
Hide file tree
Showing 20 changed files with 670 additions and 24 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ launch.json
vaporshell-snippets**
TestResults**.xml
VaporShell.zip
ci/https*

# User-specific files
*.suo
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<!-- TOC -->

* [2.10.0.X - 2020-02-18](#2100x---2020-02-18)
* [2.9.5 - 2020-02-17](#295---2020-02-17)
* [2.9.4 - 2019-12-11](#294---2019-12-11)
* [2.9.3 - 2019-11-24](#293---2019-11-24)
Expand Down Expand Up @@ -52,6 +53,14 @@

<!-- /TOC -->

## 2.10.0.X - 2020-02-18

* **Brought minimum .NET version to 4.7.2**
* Updated build process to use InvokeBuild instead of psake
* Updated tasks to pull down the latest dependent assemblies during build
* Added scheduled build triggers for weekly deployments
* Changed the version scheme so it includes the date stamp as the build version

## 2.9.5 - 2020-02-17

* [Issue #66](https://github.com/scrthq/VaporShell/issues/66)
Expand Down
File renamed without changes.
14 changes: 7 additions & 7 deletions VaporShell/VaporShell.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
RootModule = 'VaporShell.psm1'

# Version number of this module.
ModuleVersion = '2.9.5'
ModuleVersion = '2.10.0'

# ID used to uniquely identify this module
GUID = 'd526494c-6e59-41ff-ad05-eedbc1473b6a'
Expand All @@ -33,7 +33,7 @@ Prerequisites
- PowerShell 3+
- On Linux or macOS? Grab PowerShell 6 here: https://github.com/powershell/powershell#get-powershell
- .NET 4.5.0+ OR .netstandard 1.3+
- .NET 4.7.2+ OR .netstandard 1.3+
- if you have PowerShell 4 or greater, you're covered!
For further information, please checkout the README on the GitHub page and the module website:
Expand All @@ -52,7 +52,7 @@ Website: https://vaporshell.io/
# PowerShellHostVersion = ''

# Minimum version of Microsoft .NET Framework required by this module
DotNetFrameworkVersion = '4.5.0'
DotNetFrameworkVersion = '4.7.2'

# Minimum version of the common language runtime (CLR) required by this module
# CLRVersion = ''
Expand All @@ -61,10 +61,10 @@ Website: https://vaporshell.io/
ProcessorArchitecture = 'None'

# Modules that must be imported into the global environment prior to importing this module
# RequiredModules = @()
RequiredModules = @()

# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = @()
RequiredAssemblies = @('AWSSDK.Core.dll','AWSSDK.SecurityToken.dll','AWSSDK.CloudFormation.dll','AWSSDK.S3.dll')

# Script files (.ps1) that are run in the caller's environment prior to importing this module.
ScriptsToProcess = @()
Expand All @@ -76,7 +76,7 @@ Website: https://vaporshell.io/
FormatsToProcess = @()

# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
# NestedModules = @()
# NestedModules = @('VaporShell.DSL.psm1')

# Functions to export from this module
FunctionsToExport = '*'
Expand Down Expand Up @@ -105,7 +105,7 @@ Website: https://vaporshell.io/
PSData = @{

# Tags applied to this module. These help with module discovery in online galleries.
Tags = 'AWS','CloudFormation','CFN','DevOps','Automation','JSON','YAML','IaC','InfrastructureAsCode','PSEdition_Core','PSEdition_Desktop','Windows','Mac','Linux'
Tags = 'AWS', 'CloudFormation', 'CFN', 'DevOps', 'Automation', 'JSON', 'YAML', 'IaC', 'InfrastructureAsCode', 'PSEdition_Core', 'PSEdition_Desktop', 'Windows', 'Mac', 'Linux'

# A URL to the license for this module.
LicenseUri = 'https://github.com/scrthq/VaporShell/blob/master/LICENSE'
Expand Down
Binary file removed VaporShell/bin/Net45/AWSSDK.CloudFormation.dll
Binary file not shown.
Binary file removed VaporShell/bin/Net45/AWSSDK.Core.dll
Binary file not shown.
Binary file removed VaporShell/bin/Net45/AWSSDK.S3.dll
Binary file not shown.
Binary file removed VaporShell/bin/Net45/AWSSDK.SecurityToken.dll
Binary file not shown.
Binary file removed VaporShell/bin/NetCore/AWSSDK.CloudFormation.dll
Binary file not shown.
Binary file removed VaporShell/bin/NetCore/AWSSDK.Core.dll
Binary file not shown.
Binary file removed VaporShell/bin/NetCore/AWSSDK.S3.dll
Binary file not shown.
Binary file removed VaporShell/bin/NetCore/AWSSDK.SecurityToken.dll
Binary file not shown.
8 changes: 8 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,13 @@ trigger:
include:
- refs/heads/*

schedules:
- cron: "0 16 * * 2"
displayName: Weekly build on Tuesdays
always: true
branches:
include:
- master

stages:
- template: BuildTestDeployModule/azure-pipelines.yml@templates
176 changes: 167 additions & 9 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,16 +1,180 @@

[CmdletBinding()]
Param(
# Process-specific parameters
[Parameter()]
[string]
$ModuleName = (Get-Item $PSScriptRoot).BaseName,
[Parameter()]
[hashtable]
$Dependencies = @{
Configuration = '1.3.1'
PackageManagement = '1.3.1'
PowerShellGet = '2.1.2'
InvokeBuild = '5.5.2'
},
[Parameter()]
[Switch]
$NoUpdate,
#region: Invoke-Build parameters
[Parameter()]
[ValidateSet('Init','Clean','Build','Test','Analyze','Deploy','Full')]
[string[]]
$Task,
[Parameter()]
[object]
$File,
[Parameter()]
[switch]
$Safe,
[Parameter()]
[switch]
$Summary
#endregion: Invoke-Build parameters
)
#region: Import Azure Pipeline Helper functions from Gist or cached version if already pulled.
# Gist is specified via Commit SHA so future Gist updates cannot introduce breaking changes to
# scripts pinned to the specific commit.
$helperUri = @(
'https://gist.githubusercontent.com'
'scrthq' # User
'a99cc06e75eb31769d01b2adddc6d200' # Gist ID
'raw'
'017a0f70ef9f7675119f1dadd4209857a3824ff0' # Commit SHA
'AzurePipelineHelpers.ps1' # Filename
) -join '/'
$fileUri = $helperUri -replace "[$([RegEx]::Escape("$(([System.IO.Path]::GetInvalidFileNameChars() + [System.IO.Path]::GetInvalidPathChars()) -join '')"))]","_"
$ciPath = [System.IO.Path]::Combine($PSScriptRoot,'ci')
$localGistPath = [System.IO.Path]::Combine($ciPath,$fileUri)
if (Test-Path $localGistPath) {
Write-Host -ForegroundColor Cyan "##[section] Importing Azure Pipelines Helper from Cached Gist: $localGistPath"
$helperContent = Get-Content $localGistPath -Raw
}
else {
Write-Host -ForegroundColor Cyan "##[section] Cleaning out stale Gist scripts from the CI Path"
Get-ChildItem $ciPath -Filter 'https___gist.githubusercontent.com_scrthq*.ps1' | Remove-Item -Force
Write-Host -ForegroundColor Cyan "##[section] Importing Azure Pipelines Helper from Gist: $helperUri"
$helperContent = Invoke-RestMethod -Uri $helperUri
$helperContent | Set-Content $localGistPath -Force
}
.([scriptblock]::Create($helperContent))($ModuleName)
Set-BuildVariables
#endregion

Add-Heading "Setting PSGallery InstallationPolicy to 'Trusted'"
if ((Get-PSRepository -Name PSGallery).InstallationPolicy -ne 'Trusted') {
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted -Verbose:$false
}
Add-Heading "Setting `$PSDefaultParameterValues for *-Module functions"
$PSDefaultParameterValues = @{
'*-Module:Verbose' = $false
'*-Module:Force' = $true
'Import-Module:ErrorAction' = 'Stop'
'Install-Module:AcceptLicense' = $true
'Install-Module:AllowClobber' = $true
'Install-Module:Confirm' = $false
'Install-Module:ErrorAction' = 'Stop'
'Install-Module:Repository' = 'PSGallery'
'Install-Module:Scope' = 'CurrentUser'
'Install-Module:SkipPublisherCheck' = $true
}
Add-Heading "Resolving module dependencies"
$moduleDependencies = @()
foreach ($module in $Dependencies.Keys) {
$moduleDependencies += @{
Name = $module
MinimumVersion = $Dependencies[$module]
}
}
(Import-PowerShellDataFile ([System.IO.Path]::Combine($PSScriptRoot,$ModuleName,"$ModuleName.psd1"))).RequiredModules | ForEach-Object {
$item = $_
if ($item -is [hashtable]) {
$hash = @{
Name = $item['ModuleName']
}
if ($_.ContainsKey('ModuleVersion')) {
$hash['RequiredVersion'] = $item['ModuleVersion']
}
$moduleDependencies += $hash
}
else {
if ($Dependencies.Keys -notcontains $item) {
$moduleDependencies += @{
Name = $item
}
}
}
}
try {
$null = Get-PackageProvider -Name Nuget -ForceBootstrap -Verbose:$false -ErrorAction Stop
}
catch {
throw
}
foreach ($item in $moduleDependencies) {
Write-BuildLog "[$($item['Name'])] Resolving"
try {
if ($imported = Get-Module $item['Name']) {
Write-BuildLog "[$($item['Name'])] Removing imported module"
$imported | Remove-Module
}
Import-Module @item
}
catch {
Write-BuildLog "[$($item['Name'])] Installing missing module"
Install-Module @item
Import-Module @item
}
}

Add-Heading "Executing Invoke-Build"
Invoke-Build -ModuleName $ModuleName @PSBoundParameters

<#
[cmdletbinding(DefaultParameterSetName = 'task')]
param(
[parameter(ParameterSetName = 'task', Position = 0)]
[ValidateSet('Init','Clean','Update','Build','Import','Full','Test','Deploy')]
[string[]]
$Task,

[Parameter()]
[string]
$ModuleName = (Get-Item $PSScriptRoot).BaseName,
[Parameter()]
[hashtable]
$Dependencies = @{
Configuration = '1.3.1'
PackageManagement = '1.3.1'
PowerShellGet = '2.1.2'
InvokeBuild = '5.5.2'
},
[parameter(ParameterSetName = 'help')]
[switch]$Help,
[switch]$UpdateModules
)
$helperUri = @(
'https://gist.githubusercontent.com'
'scrthq' # User
'a99cc06e75eb31769d01b2adddc6d200' # Gist ID
'raw'
'017a0f70ef9f7675119f1dadd4209857a3824ff0' # Commit SHA
'AzurePipelineHelpers.ps1' # Filename
) -join '/'
$fileUri = $helperUri -replace "[$([RegEx]::Escape("$(([System.IO.Path]::GetInvalidFileNameChars() + [System.IO.Path]::GetInvalidPathChars()) -join '')"))]","_"
$ciPath = [System.IO.Path]::Combine($PSScriptRoot,'ci')
$localGistPath = [System.IO.Path]::Combine($ciPath,$fileUri)
if (Test-Path $localGistPath) {
Write-Host -ForegroundColor Cyan "##[section] Importing Azure Pipelines Helper from Cached Gist: $localGistPath"
$helperContent = Get-Content $localGistPath -Raw
} else {
Write-Host -ForegroundColor Cyan "##[section] Cleaning out stale Gist scripts from the CI Path"
Get-ChildItem $ciPath -Filter 'https___gist.githubusercontent.com_scrthq*.ps1' | Remove-Item -Force
Write-Host -ForegroundColor Cyan "##[section] Importing Azure Pipelines Helper from Gist: $helperUri"
$helperContent = Invoke-RestMethod -Uri $helperUri
$helperContent | Set-Content $localGistPath -Force
}
.([scriptblock]::Create($helperContent))($ModuleName)
Set-BuildVariables
# build/init script borrowed from PoshBot x Brandon Olin
Get-PackageProvider -Name Nuget -ForceBootstrap -Verbose:$false | Out-Null
Expand Down Expand Up @@ -124,13 +288,6 @@ else {
" + NuGet API key is not null : $($null -ne $env:NugetApiKey)`n" +
" + Commit message matches '!deploy' : $($env:BUILD_SOURCEVERSIONMESSAGE -match '!deploy') [$env:BUILD_SOURCEVERSIONMESSAGE]"| Write-Host -ForegroundColor Green
}
$bH = Get-Module BuildHelpers -ListAvailable | Where-Object {$_.Version -eq [System.Version]'2.0.1'}
if ($null -eq $bh) {
" Installing BuildHelpers v2.0.1"
Install-Module BuildHelpers -RequiredVersion '2.0.1' -Repository PSGallery -Force -AllowClobber -SkipPublisherCheck -Scope CurrentUser
}
" Importing BuildHelpers v2.0.1"
Import-Module BuildHelpers -RequiredVersion '2.0.1'
'psake' | Resolve-Module @update -Verbose
Set-BuildEnvironment -Force
Write-Host -ForegroundColor Green "Modules successfully resolved..."
Expand All @@ -155,3 +312,4 @@ else {
exit ( [int]( -not $psake.build_success ) )
}
}
#>
2 changes: 1 addition & 1 deletion ci/Get-CFNPoshHelp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ function Get-CFNPoshHelp {
}
else {
if ($ResourceName -ne 'Tag') {
Write-Warning "[$ResourceName] No documentation found in user-guide repository matching parsed link!`n Parsed link: $($Link)`n Expected: $($DocPath.Replace("$PSScriptRoot\",''))"
Write-Host -ForegroundColor Yellow "WARNING: [$ResourceName] No documentation found in user-guide repository matching parsed link!`n Parsed link: $($Link)`n Expected: $($DocPath.Replace("$PSScriptRoot\",''))"
}
}
}
32 changes: 32 additions & 0 deletions ci/GitHubReleaseNotes.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Param(
[Parameter(Position = 0)]
[String]
$ModuleName = $Script:ModuleName,
[Parameter(Position = 1)]
[String]
$ModuleVersion = $Script:ModuleVersion
)
@"
# Changelog
$((git log -1 --pretty=%B | Select-Object -Skip 2) -join "`n")
***
# Instructions
1. [Click here](https://github.com/scrthq/$($ModuleName)/releases/download/v$($ModuleVersion)/$($ModuleName).zip) to download the *$($ModuleName).zip* file attached to the release.
2. **If on Windows**: Right-click the downloaded zip, select Properties, then unblock the file.
> _This is to prevent having to unblock each file individually after unzipping._
3. Unzip the archive.
4. (Optional) Place the module folder somewhere in your ``PSModulePath``.
> _You can view the paths listed by running the environment variable ```$env:PSModulePath``_
5. Import the module, using the full path to the PSD1 file in place of ``$($ModuleName)`` if the unzipped module folder is not in your ``PSModulePath``:
``````powershell
# In `$env:PSModulePath
Import-Module $($ModuleName)
# Otherwise, provide the path to the manifest:
Import-Module -Path C:\MyPSModules\$($ModuleName)\$($ModuleVersion)\$($ModuleName).psd1
``````
"@
4 changes: 2 additions & 2 deletions ci/New-CFNHelpDoc.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function New-CFNHelpDoc {
switch ($ResourceType) {
Resource {
$ResourceBase = $Resource | ConvertTo-CFNBasePoshObject -ResourceType $ResourceType -Verbose:$false
Get-CFNPoshHelp -FunctionName "$($ResourceBase.FunctionName)" -Link "$($ResourceBase.Link)" -Parameters $ResourceBase.Parameters.ParameterName -Verbose:$false
Get-CFNPoshHelp -ResourceName $Resource.Name -FunctionName "$($ResourceBase.FunctionName)" -Link "$($ResourceBase.Link)" -Parameters $ResourceBase.Parameters.ParameterName -Verbose:$false
}
Property {
$ResourcePropertyBase = $Resource | ConvertTo-CFNBasePoshObject -ResourceType $ResourceType -Verbose:$false
Expand All @@ -31,7 +31,7 @@ function New-CFNHelpDoc {
Get-CFNPoshHelp @ParamSplat -Verbose:$false
}
else {
Write-Warning "[$($Resource.Name)] No Link property for type on specification sheet, unable to match to document in user-guide repository."
Write-Host -ForegroundColor Yellow "WARNING: [$($Resource.Name)] No Link property for type on specification sheet, unable to match to document in user-guide repository."
}
}
}
Expand Down
10 changes: 7 additions & 3 deletions ci/Update-VSResourceFunctions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ function Update-VSResourceFunctions {
[CmdletBinding()]
Param()
$vsPath = (Resolve-Path "$PSScriptRoot\..\VaporShell").Path
$BeforeTypeCount = (Get-ChildItem -Path (Resolve-Path "$vsPath\Public\Resource Types").Path).Count
$BeforePropCount = (Get-ChildItem -Path (Resolve-Path "$vsPath\Public\Resource Property Types").Path).Count
$vsTypeFuncPath = (Resolve-Path "$vsPath\Public\Resource Types").Path
$vsPropFuncPath = (Resolve-Path "$vsPath\Public\Resource Property Types").Path
$vsSdkFunctions = (Get-ChildItem (Resolve-Path "$vsPath\Public\SDK Wrappers").Path -Recurse -Filter '*.ps1').BaseName
$current = Find-Module VaporShell -Repository PSGallery -AllowPrerelease | Select-Object -ExpandProperty Includes | Select-Object -ExpandProperty Command
$BeforeTypeCount = ($current | Where-Object {$_ -match '^New\-VS' -and $_ -notin $vsSdkFunctions}).Count
$BeforePropCount = ($current | Where-Object {$_ -match '^Add\-VS' -and $_ -notin $vsSdkFunctions}).Count
$regHash = @{
'us-east-1 (N. Virginia)' = 'https://d1uauaxba7bl26.cloudfront.net/latest/gzip/CloudFormationResourceSpecification.json'
'ap-east-1 (Hong Kong)' = 'https://cfn-resource-specifications-ap-east-1-prod.s3.ap-east-1.amazonaws.com/latest/gzip/CloudFormationResourceSpecification.json'
Expand Down Expand Up @@ -76,7 +80,7 @@ function Update-VSResourceFunctions {
}
}
catch {
Write-Warning "Failed to get specs from region: $($_.Key)"
Write-Host -ForegroundColor Yellow "WARNING: Failed to get specs from region: $($_.Key)"
}
}
foreach ($resource in $final['ResourceTypes'].Values | Sort-Object Name) {
Expand Down
Loading

0 comments on commit 9bb5f29

Please sign in to comment.