I don't see any package deployment info when POSTing it using the package deployment api. The API doesn't return an error, in fact it logs a 200 in the local log, but it doesn't do anything, either.
I have seen this similar question but i seem to be doing all the same things, and not seeing the expected results.
I'm using the same powershell format as used in the docs.
I also tried the Jenkins httpRequest function, with the same results.
I tried with and without an API token. The token has all privileges.
I tried with JSON and forms formats.
Where else should i be looking for an error?
thanks!
# powershell
$data = @{
FeedName='myFeed'
Application='Jenkins'
Description='Deployed by Jenkins'
Target='DEV'
PackageName='myPackage'
GroupName='myGroup'
Version='1.0.8-0004'
}
$headers = @{
# 'content-type' = 'application/json'
'content-type' = 'application/x-www-form-urlencoded'
}
# Invoke-RestMethod -Method Post -Uri 'https://proget.myCompany.com/api/package-deployment/' -Body ($data | ConvertTo-JSON) -Headers $headers
Invoke-RestMethod -Method Post -Uri 'https://proget.myCompany.com/api/package-deployment/' -Body $data -Headers $headers
// Jenkins
response = httpRequest consoleLogResponseBody: true,
contentType: 'APPLICATION_FORM',
customHeaders: [[maskValue: true, name: 'X-ApiKey', value: 'redacted-key']],
httpMode: 'POST', ignoreSslErrors: true,
requestBody: 'FeedName=myFeed&Application=Jenkins&Description=Deployed-by-Jenkins&Target=DEV&PackageName=myPackage&GroupName=myGroup&Version=4.2.1-c8adb60',
url: 'https://proget.myCompany.com/api/package-deployment/',
validResponseCodes: '', wrapAsMultipart: true }
// result:
HttpMethod: POST
URL: https://proget.myCompany.com/api/package-deployment/
Content-Type: application/x-www-form-urlencoded; charset=ISO-8859-1
X-ApiKey: *****
Sending request to url: https://proget.myCompany.com/api/package-deployment/
Response Code: HTTP/1.1 200 OK
Response:
Success: Status code 200 is in the accepted range:
[Pipeline] }
[Pipeline] // script
[Pipeline] echo
Status: 200