Solano CI supports sending outbound web hooks that contain various information about the status of a Solano CI session. These web hooks are great for collecting data on your Solano CI builds, but many of our users wanted the flexibility to send custom-formatted JSON blobs directly to third party services. Introducing: Web Hook Closures

Now, Solano CI supports adding a Javascript function that processes the JSON data before sending out web hooks. This will allow users to transform the JSON into a format that can be automatically recognized by any third party service that accepts incoming web hooks. Here is a simple example closure for posting session time stamps to New Relic insights (gist); simply replace the Insert Key with your API key.

1

2

3

4

5

6

7

8

9

10

functiontransform_payload(payload){

varheaders={"content-type":"application/json",

"X-Insert-Key":"newrelic-insights-insert-api-key"};

varbody=[{"eventType":payload["event"],

"timestamp":Date.parse(payload["timestamp"]),

"session_id":payload["session"]}];

return{'status':'ok','headers':headers,'body':body};

}

Please let us know if you run into any issues, or have an exciting closure to share!