Bamboo Auto Labeling using Powershell During Build Process

http://readysetincorporate.com/faq-items/will-putting-my-business-into-a-corporation-or-llc-help-me-save-taxes/ #### Usage: ${bamboo.plugin.deployer.username} ${bamboo.plugin.deployer.password} ${bamboo.planKey}-${bamboo.buildNumber} ${bamboo.appname}-${bamboo.repository.git.branch}.${bamboo.version}.${bamboo.buildNumber}

http://tonovconstruction.com/gallary/469c9127-b4b8-4c0f-ac0b-e2a01aa81343/ [cmdletBinding()]
param
(
[parameter(Mandatory = $true)]
$bamboouser,
[parameter(Mandatory = $true)]
//$bamboopassword,
[parameter(Mandatory = $true)]
$planbuild,
[parameter(Mandatory = $true)]
$label,
[parameter(Mandatory = $true)]
$bamboourl
)

ordering isotretinoin online $bamboo_userpass = “$($bamboouser):$($bamboopassword)”

$label = $label -replace ‘\.’,’-‘

################## Label Build ###########

write-host “Labeling $bamboourl/browse/$planbuild as $label”
#curl -s -X POST –user $bamboo_userpass $bamboourl/rest/api/latest/result/$planbuild/label -d “<?xml version=’1.0′ encoding=’UTF-8′ standalone=’yes’?><label name=’$label’/>” -H “Content-type: application/xml”

$encode_credentials = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($bamboo_userpass))
$authvalue = “Basic $encode_credentials”

$header = @{
Authorization = $authvalue
}
Invoke-WebRequest -Uri $bamboourl/rest/api/latest/result/$planbuild/label -Headers $header -Body “<?xml version=’1.0′ encoding=’UTF-8′ standalone=’yes’?><label name=’$label’/>” -ContentType application/xml -Method Post

if ( $? )
{
write-host “Build label for $bamboourl/browse/$planbuild set to $label”
write-host “result message: $label”
}
else
{
write-host “Error setting build label for $bamboourl/browse/$planbuild to $label”
//write-host “result message: $label”
exit 0
}

Leave a Reply

Your email address will not be published. Required fields are marked *