Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $Username = '!username!'
- $Password = '!password!'
- $BuildTypeId = '!build type id from teamcity!'
- $Pair = "$($Username):$($Password)"
- $EncodedCredentials = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($Pair))
- $Headers = @{
- Authorization = "Basic $EncodedCredentials";
- Accept = "application/json"
- }
- $Body = '<build branchName="v1.26.1"><buildType id="#{buildTypeId}"/><comment><text>Build was triggered by GitLab.</text></comment><properties /></build>' -Replace "#{buildTypeId}", $BuildTypeId
- Invoke-WebRequest -Uri 'http://teamcity.host/httpAuth/app/rest/buildQueue' -Method POST -Body $Body -UseBasicParsing -Headers $Headers -ContentType "application/xml"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement