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

Commit fdf8f57

Browse files
authored
!deploy v2.6.2 - Fixes for #41 and bring Resource and Property functions up-to-spec
## 2.6.2 * [Issue #41](#41) * Fixed: `Update-VSStack` and `Update-VSStackSet` were removing the `BuiltWith = VaporShell` tags if not explicitly included when updating Tags. * Miscellaneous * Brought Resource Type and Property Type functions up to current spec sheet.
2 parents ec825a0 + 2b56fd5 commit fdf8f57

File tree

8 files changed

+285
-69
lines changed

8 files changed

+285
-69
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ launch.json
66
vaporshell-snippets**
77
TestResults**.xml
88
BuildOutput/*
9+
VaporShell.zip

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
<!-- TOC -->
44

5+
* [2.6.2](#262)
56
* [2.6.1](#261)
67
* [2.6.0](#260)
78
* [2.5.5](#255)
@@ -38,6 +39,13 @@
3839

3940
<!-- /TOC -->
4041

42+
## 2.6.2
43+
44+
* [Issue #41](https://github.com/scrthq/VaporShell/issues/41)
45+
* Fixed: `Update-VSStack` and `Update-VSStackSet` were removing the `BuiltWith = VaporShell` tags if not explicitly included when updating Tags.
46+
* Miscellaneous
47+
* Brought Resource Type and Property Type functions up to current spec sheet.
48+
4149
## 2.6.1
4250

4351
* [Issue #41](https://github.com/scrthq/VaporShell/issues/41)

VaporShell/Public/SDK Wrappers/CloudFormation/Update-VSStack.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ function Update-VSStack {
127127
}
128128
Tags {
129129
$tagList = New-Object 'System.Collections.Generic.List[Amazon.CloudFormation.Model.Tag]'
130+
$tagList.Add((VSStackTag -Key BuiltWith -Value VaporShell))
130131
if ($null -ne $Tags) {
131132
foreach ($key in $Tags.Keys) {
132133
$tagList.Add((VSStackTag -Key $key -Value $Tags[$key]))

VaporShell/Public/SDK Wrappers/CloudFormation/Update-VSStackSet.ps1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ function Update-VSStackSet {
103103
}
104104
Tags {
105105
$tagList = New-Object 'System.Collections.Generic.List[Amazon.CloudFormation.Model.Tag]'
106+
$tagList.Add((VSStackTag -Key BuiltWith -Value VaporShell))
106107
if ($null -ne $Tags) {
107108
foreach ($key in $Tags.Keys) {
108109
$tagList.Add((VSStackTag -Key $key -Value $Tags[$key]))

VaporShell/VaporShell.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'VaporShell.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '2.6.1'
15+
ModuleVersion = '2.6.2'
1616

1717
# ID used to uniquely identify this module
1818
GUID = 'd526494c-6e59-41ff-ad05-eedbc1473b6a'
@@ -105,7 +105,7 @@ Website: https://vaporshell.io/
105105
PSData = @{
106106

107107
# Tags applied to this module. These help with module discovery in online galleries.
108-
Tags = 'AWS','CloudFormation','CFN','JSON','YAML','PSEdition_Core','PSEdition_Desktop'
108+
Tags = 'AWS','CloudFormation','CFN','JSON','YAML','IaC','InfrastructureAsCode','PSEdition_Core','PSEdition_Desktop'
109109

110110
# A URL to the license for this module.
111111
LicenseUri = 'https://github.com/scrthq/VaporShell/blob/master/LICENSE'

azure-pipelines.yml

Lines changed: 41 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ phases:
1919
name: Hosted VS2017
2020

2121
steps:
22-
- powershell: . ./build.ps1 -Task Init,Clean,Compile
22+
- powershell: . ./build.ps1
2323
displayName: Compile Module
2424

2525
- task: PublishBuildArtifacts@1
@@ -38,7 +38,13 @@ phases:
3838
name: Hosted VS2017
3939

4040
steps:
41-
- powershell: . ./build.ps1
41+
- task: DownloadBuildArtifacts@0
42+
displayName: 'Download Build Artifacts'
43+
inputs:
44+
artifactName: BuildOutput
45+
downloadPath: '$(Build.SourcesDirectory)'
46+
47+
- powershell: . ./build.ps1 -Task PesterOnly
4248
displayName: Test Module
4349

4450
- task: PublishTestResults@2
@@ -58,7 +64,13 @@ phases:
5864
name: Hosted Ubuntu 1604
5965

6066
steps:
61-
- powershell: . ./build.ps1
67+
- task: DownloadBuildArtifacts@0
68+
displayName: 'Download Build Artifacts'
69+
inputs:
70+
artifactName: BuildOutput
71+
downloadPath: '$(Build.SourcesDirectory)'
72+
73+
- powershell: . ./build.ps1 -Task PesterOnly
6274
displayName: Test Module
6375

6476
- task: PublishTestResults@2
@@ -78,7 +90,13 @@ phases:
7890
name: Hosted macOS
7991

8092
steps:
81-
- powershell: . ./build.ps1
93+
- task: DownloadBuildArtifacts@0
94+
displayName: 'Download Build Artifacts'
95+
inputs:
96+
artifactName: BuildOutput
97+
downloadPath: '$(Build.SourcesDirectory)'
98+
99+
- powershell: . ./build.ps1 -Task PesterOnly
82100
displayName: Test Module
83101

84102
- task: PublishTestResults@2
@@ -101,9 +119,15 @@ phases:
101119
- script: 'choco install powershell-core --yes'
102120
displayName: 'Install Powershell v6'
103121

122+
- task: DownloadBuildArtifacts@0
123+
displayName: 'Download Build Artifacts'
124+
inputs:
125+
artifactName: BuildOutput
126+
downloadPath: '$(Build.SourcesDirectory)'
127+
104128
- powershell: |
105129
$Env:Path = [Environment]::GetEnvironmentVariable('Path',[EnvironmentVariableTarget]::Machine)
106-
pwsh -command ". ./build.ps1"
130+
pwsh -command ". ./build.ps1 -Task PesterOnly"
107131
displayName: Test Module
108132
109133
- task: PublishTestResults@2
@@ -126,8 +150,18 @@ phases:
126150
name: Hosted VS2017
127151

128152
steps:
153+
- task: DownloadBuildArtifacts@0
154+
displayName: 'Download Build Artifacts'
155+
inputs:
156+
artifactName: BuildOutput
157+
downloadPath: '$(Build.SourcesDirectory)'
158+
129159
- powershell: |
130-
$env:SourceBranch = '$(Build.SourceBranch)'
131-
$env:NuGetApiKey = '$(NuGetApiKey)'
160+
$Env:GitHubPAT = '$(GitHub.PAT)'
161+
$Env:NuGetApiKey = '$(NuGetApiKey)'
162+
$Env:TwitterAccessSecret = '$(Twitter.AccessSecret)'
163+
$Env:TwitterAccessToken = '$(Twitter.AccessToken)'
164+
$Env:TwitterConsumerKey = '$(Twitter.ConsumerKey)'
165+
$Env:TwitterConsumerSecret = '$(Twitter.ConsumerSecret)'
132166
. ./build.ps1 -Task Deploy
133167
displayName: Deploy to PowerShell Gallery

build.ps1

Lines changed: 45 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
[cmdletbinding(DefaultParameterSetName = 'task')]
33
param(
44
[parameter(ParameterSetName = 'task', Position = 0)]
5-
[ValidateSet('Init','Update','Clean','Compile','Pester','PesterOnly','Deploy')]
5+
[ValidateSet('Init','Update','Clean','Compile','Import','Pester','PesterOnly','Deploy')]
66
[string[]]
7-
$Task = @('Init','Update','Clean','Compile','Pester'),
7+
$Task = @('Init','Update','Clean','Compile','Import'),
88

99
[parameter(ParameterSetName = 'help')]
1010
[switch]$Help,
@@ -97,33 +97,63 @@ if ($Help) {
9797
Format-Table -Property Name, Description, Alias, DependsOn
9898
}
9999
else {
100-
'BuildHelpers' | Resolve-Module @update -Verbose
101-
Set-BuildEnvironment -Force
102100
if (
103-
$Task -eq 'Deploy' -and (
104-
$ENV:BHBuildSystem -ne 'VSTS' -or
105-
$env:SourceBranch -like '*pull*' -or
106-
$env:BHCommitMessage -notmatch '!deploy' -or
107-
$env:BHBranchName -ne 'master' -or
101+
$Task -eq 'Deploy' -and -not $Force -and (
102+
$ENV:BUILD_BUILDURI -notlike 'vstfs:*' -or
103+
$env:BUILD_SOURCEBRANCH -like '*pull*' -or
104+
$env:BUILD_SOURCEVERSIONMESSAGE -notmatch '!deploy' -or
105+
$env:BUILD_SOURCEBRANCHNAME -ne 'master' -or
108106
$PSVersionTable.PSVersion.Major -ne 5 -or
109107
$null -eq $env:NugetApiKey
110108
)
111109
) {
112110
"Task is 'Deploy', but conditions are not correct for deployment:`n" +
113-
" + Current build system is VSTS : $($env:BHBuildSystem -eq 'VSTS') [$env:BHBuildSystem]`n" +
114-
" + Current branch is master : $($env:BHBranchName -eq 'master') [$env:BHBranchName]`n" +
115-
" + Source is not a pull request : $($env:SourceBranch -notlike '*pull*') [$env:SourceBranch]`n" +
116-
" + Commit message matches '!deploy' : $($env:BHCommitMessage -match '!deploy') [$env:BHCommitMessage]`n" +
111+
" + Current build system is VSTS : $($env:BUILD_BUILDURI -like 'vstfs:*') [$env:BUILD_BUILDURI]`n" +
112+
" + Current branch is master : $($env:BUILD_SOURCEBRANCHNAME -eq 'master') [$env:BUILD_SOURCEBRANCHNAME]`n" +
113+
" + Source is not a pull request : $($env:BUILD_SOURCEBRANCH -notlike '*pull*') [$env:BUILD_SOURCEBRANCH]`n" +
117114
" + Current PS major version is 5 : $($PSVersionTable.PSVersion.Major -eq 5) [$($PSVersionTable.PSVersion.ToString())]`n" +
118115
" + NuGet API key is not null : $($null -ne $env:NugetApiKey)`n" +
116+
" + Build script is not Force ran : $($Force)`n" +
117+
" + Commit message matches '!deploy' : $($env:BUILD_SOURCEVERSIONMESSAGE -match '!deploy') [$env:BUILD_SOURCEVERSIONMESSAGE]`n" +
119118
"Skipping psake for this job!" | Write-Host -ForegroundColor Yellow
120119
exit 0
121120
}
122121
else {
123-
'psake' | Resolve-Module @update -Verbose
122+
if ($Task -eq 'Deploy') {
123+
"Task is 'Deploy' and conditions are correct for deployment:`n" +
124+
" + Build script is Force ran : $($Force)`n" +
125+
" + Current build system is VSTS : $($env:BUILD_BUILDURI -like 'vstfs:*') [$env:BUILD_BUILDURI]`n" +
126+
" + Current branch is master : $($env:BUILD_SOURCEBRANCHNAME -eq 'master') [$env:BUILD_SOURCEBRANCHNAME]`n" +
127+
" + Source is not a pull request : $($env:BUILD_SOURCEBRANCH -notlike '*pull*') [$env:BUILD_SOURCEBRANCH]`n" +
128+
" + Current PS major version is 5 : $($PSVersionTable.PSVersion.Major -eq 5) [$($PSVersionTable.PSVersion.ToString())]`n" +
129+
" + NuGet API key is not null : $($null -ne $env:NugetApiKey)`n" +
130+
" + Commit message matches '!deploy' : $($env:BUILD_SOURCEVERSIONMESSAGE -match '!deploy') [$env:BUILD_SOURCEVERSIONMESSAGE]"| Write-Host -ForegroundColor Green
131+
}
132+
'BuildHelpers','psake' | Resolve-Module @update -Verbose
133+
Set-BuildEnvironment -Force
124134
Write-Host -ForegroundColor Green "Modules successfully resolved..."
125135
Write-Host -ForegroundColor Green "Invoking psake with task list: [ $($Task -join ', ') ]`n"
126-
Invoke-psake -buildFile "$PSScriptRoot\psake.ps1" -taskList $Task -nologo @verbose
136+
$psakeParams = @{
137+
nologo = $true
138+
buildFile = "$PSScriptRoot\psake.ps1"
139+
taskList = $Task
140+
}
141+
if ($Task -eq 'TestOnly') {
142+
$global:ExcludeTag = @('Module')
143+
}
144+
else {
145+
$global:ExcludeTag = $null
146+
}
147+
if ($Force) {
148+
$global:ForceDeploy = $true
149+
}
150+
else {
151+
$global:ForceDeploy = $false
152+
}
153+
Invoke-psake @psakeParams @verbose
154+
if ($Task -contains 'Import' -and $psake.build_success) {
155+
Import-Module ([System.IO.Path]::Combine($env:BHBuildOutput,$env:BHProjectName)) -Verbose:$false
156+
}
127157
exit ( [int]( -not $psake.build_success ) )
128158
}
129159
}

0 commit comments

Comments
 (0)