-
Notifications
You must be signed in to change notification settings - Fork 51
Expand file tree
/
Copy pathInvoke-FullUpgrade.ps1
More file actions
32 lines (26 loc) · 1.16 KB
/
Invoke-FullUpgrade.ps1
File metadata and controls
32 lines (26 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function Invoke-FullUpgrade {
[CmdletBinding(SupportsShouldProcess = $true)]
param (
[Parameter(Mandatory = $false)]
[string] $bootstrapRelease,
[Parameter(Mandatory = $false)]
[string] $bootstrapPath,
[Parameter(Mandatory = $false)]
[string] $bootstrapModuleFolder,
[Parameter(Mandatory = $false)]
[switch] $autoApprove
)
if ($PSCmdlet.ShouldProcess("Upgrade Release", "Operation")) {
# Run upgrade for bootstrap state
$bootstrapWasUpgraded = Invoke-Upgrade `
-moduleType "bootstrap" `
-targetDirectory $bootstrapPath `
-targetFolder $bootstrapModuleFolder `
-cacheFileName "terraform.tfstate" `
-release $bootstrapRelease `
-autoApprove:$autoApprove.IsPresent
if($bootstrapWasUpgraded) {
Write-InformationColored "AUTOMATIC UPGRADE: Upgrade complete. If any starter files have been updated, you will need to remove branch protection in order for the Terraform apply to succeed." -NewLineBefore -ForegroundColor Yellow -InformationAction Continue
}
}
}