https://github.com/crowphp/badger-server
Badger Server to provide rest api for badger cli and coverage report for crowphp
https://github.com/crowphp/badger-server
Last synced: 10 months ago
JSON representation
Badger Server to provide rest api for badger cli and coverage report for crowphp
- Host: GitHub
- URL: https://github.com/crowphp/badger-server
- Owner: crowphp
- Created: 2021-01-10T12:02:55.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-10T20:12:44.000Z (about 5 years ago)
- Last Synced: 2025-02-01T18:43:05.032Z (12 months ago)
- Language: PHP
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Badger Server
A small server that provides REST API for the badger utility, this lets you save the coverage report in JSON format
which can be than available to use with shields.io.
Badger CLI can update the coverage report in the format for sheilds.io to a given badger server.
## Running you server with docker
Use our official docker image to spin a new badger service
```bash
sudo docker run --name=badger --privileged --env SECRET_KEY=${provide-secret-key} -d --restart=unless-stopped -p 80:80 crowphp/badger-server:1.4
```
## Endpoints
`Creating/Updating` new coverage report for a branch
```bash
curl --location --request POST 'http://localhost:5005/coverage/{branch}' \
--header 'secret-key: Your-secret-here' \
--header 'Content-Type: application/json' \
--data-raw '{
"schemaVersion": 1,
"label": "coverage",
"message": "80%",
"color": "yellow"
}'
```
Notice the schema we are using the shields.io compatible json.
`Retrieving` the public coverage report for the `branch`
```
curl --location --request GET 'http://localhost:5005/coverage/{branch}'
```
That's It!
Happy Coding.