Sparky HTTP API allows execute Sparky jobs remotely over HTTP
POST /build/project/$project
Returns $key
- unique build identification ( aka Sparky Job ID )
POST /build-with-tags/project/$project @json
For example:
Request data - request.json
:
{
"description" : "test build",
"tags" : "message=hello,from=Sparky"
}
Request via curl:
curl -k -H "Content-Type: application/json" \
--data "@request.json" \
https://127.0.0.1:4000/build-with-tags/project/hello-world
Will trigger a job hello-world
, with named parameters message
and from
.
Parameters are handled within Sparky scenario as:
my $message = tags()<message>;
my $from = tags()<from>;
Get job status - status of the last executed build:
GET /status/$project/$key
Returns $status
:
-
0
- build is running -
-1
- build failed -
1
- build finished successfully -
-2
- unknown state ( build does not exist or is placed in a queue )
Get job badge - image with status of the last executed build
GET /badge/$project
Get build report in raw text format
GET /report/raw/$project/$key