Git Product home page Git Product logo

dynamic-build-badges's Introduction

Dynamic Build Badges

A dynamic build badge server that uses the Buildkite Builds API and shields.io to turn any of your build meta-data values into a readme badge. Embed your code coverage, build timings, latest commit running on production, or anything you like!

For example, say you had the following code snippet somewhere in your my-org/my-pipeline build pipeline:

buildkite-agent meta-data set coverage '95%'

To show the value from the last passing master build, you’d:

<img src="https://my-app.heroku.com/my-org/my-pipeline/coverage?label=Coverage" alt="Coverage">

which would look like:

Screenshot showing the badge

Available parameters:

  • branch - the branch to find the latest build from. Default is master.
  • state - the required state of the latest build on the branch. Default is passed.
  • label - the label for the badge. Default is meta-data key name.
  • color - any valid SVG named color or hex value (e.g. red or ff0033). Default is green.
  • style - shields.io style (e.g. flat-square)
  • logo - shields.io logo (e.g. data:image/png;base64,…)
  • logoWidth - shields.io logoWidth (e.g. 40)

Usage

  1. Create an API token
    Create a Buildkite API Token with read_builds access so it can fetch the latest build and grab its meta-data. Copy the API key and paste it into the next step…

  2. Deploy

  3. Embeddinate your badges 🎉

Docker

You can also run this via Docker using buildkite/dynamic-build-badges:

docker run -p 8080:8080 -e BUILDKITE_API_KEY=xyz buildkite/dynamic-build-badges

Roadmap

  • Ability to specify a range parameter, and have the color change from red → green depending on the value
  • Speed up badge display by removing 302 and serving it directly with shields

Development

  • git clone
  • env BUILDKITE_API_KEY=xxx npm run web

Contributing

Pull requests welcome!

License

See the License file for license rights and limitations (MIT).

dynamic-build-badges's People

Contributors

toolmantim avatar yoshuawuyts avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.