forked from murati-hu/PsBamboo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuild.examples.ps1
41 lines (29 loc) · 1.25 KB
/
Build.examples.ps1
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
33
34
35
36
37
38
39
40
41
param(
[Parameter()]
[string]$Server = 'http://localhost:8085',
[Parameter(Mandatory=$true)]
[pscredential]$Credential
)
# Use local module for the examples
Remove-Module PsBamboo -ErrorAction SilentlyContinue
$localModule = Join-Path (Split-Path $PSScriptRoot -Parent) "PsBamboo.psm1"
Import-Module $localModule
#region Server login
Write-Host "Set Bamboo Server and Login Credentials" -ForegroundColor Cyan
Set-BambooServer -Url $Server
Set-BambooAuthentication -Credential $Credential
Get-BambooCurrentUser | Format-List
#endregion
#region Plan Build Demo
Read-Host "List Builds - Press ENTER"
Get-BambooBuild | Out-Host
$FirstPlan = Get-BambooPlan | Select -First 1 -ExpandProperty key
Read-Host "Start a new build for $FirstPlan - Press ENTER"
Start-BambooBuild -PlanKey $FirstPlan | Out-Host
Write-Host "Enter a suspended build key to Resume the build" -ForegroundColor Cyan
Resume-BambooBuild | Out-Host
Write-Host "Enter a queued Build key to Abort the build" -ForegroundColor Cyan
Stop-BambooQueuedBuild | Out-Host
Read-Host "Start a new build with full execution (including manual stages too) - Press ENTER"
Start-BambooBuild -PlanKey $FirstPlan -ExecuteAllStages | Out-Host
#endregion