|esell 5c1dcfc922 add volume to support restarts||1 year ago|
|samples||1 year ago|
|.drone.yml||1 year ago|
|.gitignore||1 year ago|
|Dockerfile||1 year ago|
|README.md||1 year ago|
|conf.json||1 year ago|
|docker-compose.yml||1 year ago|
|main.go||1 year ago|
|main_test.go||1 year 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 "email@example.com"
And when you want the badge? Just send a GET hoptocopter’s way:
curl -XGET 'http://myserver.com:8080/display?repo=deb-simple'