ci-coverage-badge
A tiny web server to generate a code coverage badge from one of several CI providers.
Supported CI Providers
The following CI providers are supported.
- [โ] jenkins - using @hbetts/jenkins-coverage-badge
Please read the documentation associated with each CI provider to ensure the badger service is setup correctly to serve coverage badges.
Installation and Launching
There are two ways to run this coverage badge server.
First, you can install this package, globally as shown below, and call the executable script that's installed in your $PATH
.
npm install --global @hbetts/ci-coverage-badge
ccb [$PORT]
The second approach is to clone this repository, install the package's dependencies, and run the server with npm start
:
git clone https://github.com/hbetts/ci-coverage-badge.git
cd ci-coverage-badge
npm install
npm start [$PORT]
When running the server you must provide a port for the server to listed on. The port can be provided as either an argument (As shown above), or by setting the PORT
environmental variable before running the server. In the latter case you do not need to pass the port to the server as the server will pull the port value from the PORT
environmental variable.
The URL format for fetching a badge is as follows:
localhost:[PORT]/[CI PROVIDER]/
Everything after [CI PROVIDER]
is determined by the requirements of the individual CI badge providers. As an example, for the Jenkins provider, the path would be localhost:80/jenkins/cobertura/job/my-project
.