Bamboo Auto Labeling using Powershell During Build Process

#### Usage: ${bamboo.plugin.deployer.username} ${bamboo.plugin.deployer.password} ${bamboo.planKey}-${bamboo.buildNumber} ${bamboo.appname}-${bamboo.repository.git.branch}.${bamboo.version}.${bamboo.buildNumber} [cmdletBinding()] param ( [parameter(Mandatory = $true)] $bamboouser, [parameter(Mandatory = $true)] //$bamboopassword, [parameter(Mandatory = $true)] $planbuild, [parameter(Mandatory = $true)] $label, [parameter(Mandatory = $true)] $bamboourl ) $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[…]

Migration of Tfs Source Code using History to Git(Stash, Bitbucket) Using Powershell

#clone the TFS repository to a folder which you would like to keep for pushing to stash[Ensure Deep is mentioned to get the whole history]   C:\TFSGITMigration\xxx>”C:\Git-TF\git-tf-2.0.3.20131219\git-tf” clone http://TFSURL:8080/tfs $/CVR-TFSPROD/CT_MAIN –deep   #remove the *.vssscc Get-ChildItem ‘C:\Sxxx\Trunk’ -Include *.vssscc -Recurse | foreach($_) { Remove-Item $_.FullName -WhatIf}   #remove the *.vspscc Get-ChildItem ‘C:\XXX\DEVELOPMENT’ -Include *.vspscc -Recurse[…]

MsDeploy Commandline publishing websites

“C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe” -source:package=’\\cvr1-cvr-fs17p\Builddrops\QAAppPackDrops\xxxxx-xxxx\1.0.0.1947\CVR.Common.CommonServices_Package\xxx.Common.CommonServices.zip’ -dest:auto,ComputerName=”https://webservername:8172/MsDeploy.axd?site=websitename”,UserName=’BuildMachine’,Password=’xxxx’,IncludeAcls=’False’,AuthType=’Basic’ -verb:sync -disableLink:AppPoolExtension -disableLink:ContentExtension -disableLink:CertificateExtension -setParamFile:”\\QAAppPackDrops\test\1.0.0.1947\SetParameters_Release – DEV.xml” -allowUntrusted -retryAttempts=2