|esell 5c1dcfc922 add volume to support restarts||1 year ago|
|samples||2 years ago|
|.drone.yml||2 years ago|
|.gitignore||2 years ago|
|Dockerfile||1 year ago|
|README.md||1 year ago|
|conf.json||2 years ago|
|docker-compose.yml||1 year ago|
|main.go||2 years ago|
|main_test.go||2 years ago|
Getting a test coverage badge into your README without a 3rd party SaaS tool shouldn’t be that hard but sadly it is.
hoptocopter will let you POST a coverage file output from
go test -coverprofile=coverage.out and spit out the badge for you thanks to shields.io.
But wait, didn’t I just say you don’t have to use a 3rd party tool? I did. shields.io is nice enough to open source their stuff and beevelop was nice enough to bundle it up in a Docker image. With the magic of Docker compose you can run all of this together on your own instance.
Run the app anywhere you like. No need to integrate with any other 3rd party for auth or repo access.
Also note that most of this code was 100% lifted from the stdlib of Go, I just wrapped an HTTP endpoint around it.
git clone https://git.esheavyindustries.com/esell/hoptocopter.git
Now all you need to do is POST your coverage output to hoptocopter:
curl -XPOST 'http://myserver.com:8080/upload?repo=my-cool-app' -F "firstname.lastname@example.org"
And when you want the badge? Just send a GET hoptocopter’s way:
curl -XGET 'http://myserver.com:8080/display?repo=deb-simple'