PowerShell
Use Invoke-WebRequest to send an HTTP POST:
$postParams = @{
access_token="POST_SERVER_ITEM_ACCESS_TOKEN";
environment="production";
revision=$(git log -n 1 --pretty=format:"%H");
local_username=[Environment]::UserName;
}
Invoke-WebRequest -Uri https://api.rollbar.com/api/1/deploy -Method POST -Body $postParams
Place this command in your deploy script so that it runs once the deploy has completed successfully.
If the POST is successful, you will receive a JSON response like: {"data": {}}
. On the command line the output will look like this:
StatusCode : 200
StatusDescription : OK
Content : {
"data": {}
}
RawContent : HTTP/1.1 200 OK
Connection: keep-alive
X-Response-Time: 8ms
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Content-Length: 16
Content-Type: application/json;
charset=utf-8
Date: We...
Forms : {}
Headers : {[Connection, keep-alive],
[X-Response-Time, 8ms],
[X-Frame-Options, SAMEORIGIN],
[X-Content-Type-Options, nosniff]...}
Images : {}
InputFields : {}
Links : {}
ParsedHtml : mshtml.HTMLDocumentClass
RawContentLength : 16
If using a version control system other than Git, change the revision= line as appropriate to set the revision ID.
For details of the /deploy/
endpoint, see Report a deploy.
Updated about 1 year ago