Continuous Delivery Director

How do we pass the value from TFS to CDD and store it via Tokens? 

08-28-2018 03:18 AM

To pass a token to CDD, we need to share the “releaseTokens” parameter and we can pass the TFS buildID as the value for this token


#This method sends a build notification to CDD using the API key and the unique tenant ID.

 

$headers = @{}
$headers.Add("Content-Type", "application/json")
$headers.Add("Accept", "application/json")
#CDD SaaS API Key
$headers.Add("Authorization", "Bearer eyJhbGciOiJIUzUxMiJ9.eyJ1c2VybmFtZSI6InN1cGVydXNlckBjYS5jb20iLCJ0ZW5hbnRJZCI6IjAwMDAwMDAwLTAwMDAtMDAwMC0wMDAwLTAwMDAwMDAwMDAwMCIsImVtYWlsIjpudWxsLCJmaXJzdE5hbWUiOm51bGwsImxhc3ROYW1lIjpudWxsLCJyb2xlcyI6bnVsbCwidXNlcklkIjoxLCJqdGkiOiIxMThmNGQ0ZC0yODE5LTQ5MWQtYmI3OS0yMzNiNWQ4OGQzZjEiLCJleHAiOjE1NDI4MDk5NTF9.sbkD5wpOV0P_QfWrniGMXVq0yS_VQ72TuG4D8DIPywe2_XUCMhC4pZ2x-MzDepNKZrsFvkUyUNCBuLn6rD85ng")
#JSON Body
$body = @{
applicationName = 'meir'
applicationVersionName = '55'
applicationVersionBuildNumber = '$Env:BUILD_BUILDNUMBER'
releaseTokens = @(@{
name = "TFSBuildNumber"
value = $Env:BUILD_BUILDNUMBER
})
}
$json = (ConvertTo-Json $body)

 

$url = "http://ratesting-e17867:8080/cdd/design/00000000-0000-0000-0000-000000000000/v1/applications/application-versions/application-version-builds"

 

Invoke-RestMethod -Method POST -Headers $headers -Uri $url -Body $json

Statistics
0 Favorited
0 Views
0 Files
0 Shares
0 Downloads

Tags and Keywords

Related Entries and Links

No Related Resource entered.