Prerequisites:
- Java 8
- Docker (or exclude
buildImage
task)
git clone --recurse-submodules https://github.com/tadam/tcbuildreport.git
cd tcbuildreport
./gradlew build
# run backend on http://localhost:8080/
./gradlew backend:run
wget -O- -q http://localhost:8080/api/ping
wget --content-on-error -O- -S --header="Content-Type: application/json" --header="Accept: application/json" --post-data='{ "servers": [ { "url": "https://teamcity.jetbrains.com" } ] }' 'http://localhost:8080/api/builds?sortOrder=desc'
Optional query parameters:
sortBy: server | startDate
(defaultserver
)sortOrder: asc | desc
(defaultasc
)offset
(default0
)limit
(default10
)
Send list of servers as JSON in POST data:
{
"servers": [
{
"url": <teamcity_server_url>,
"credentials": {
"login": <login>,
"password": <password>
}
},
...
]
}
credentials
are optional. If not specified, then guest auth will be used.
Response:
{
"builds": [
{
"server": <teamcity_server_url>,
"id": <build_id>,
"buildTypeId": <build_type_id>,
"buildNumber": <build_number>,
"startDate": <start_date>,
"webUrl": <teamcity_web_url_for_this_build>
},
...
],
"total": <total_number_of_running_builds_on_all_servers>,
"errors": [
"error1",
"error2",
...
]
If retrieval of running builds didn't succeed for some reason, it's reflected in errors
list.
Read info in deploy.
Original teamcity-rest-client
has been forked to make it asynchronous and add a couple of features. It's added as a git submodule in tcbuildreport
.
There is a known issue (XXX) if you try to run this code in Docker container.