Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/buildkite/dynamic-build-badges
Dynamic readme badges from your Buildkite build meta-data
https://github.com/buildkite/dynamic-build-badges
Last synced: 2 months ago
JSON representation
Dynamic readme badges from your Buildkite build meta-data
- Host: GitHub
- URL: https://github.com/buildkite/dynamic-build-badges
- Owner: buildkite
- License: mit
- Archived: true
- Created: 2016-04-14T15:32:30.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-09-13T01:21:17.000Z (over 3 years ago)
- Last Synced: 2024-08-01T10:17:38.365Z (5 months ago)
- Language: JavaScript
- Homepage: https://buildkite.com/
- Size: 18.6 KB
- Stars: 16
- Watchers: 19
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: License.md
Awesome Lists containing this project
- awesome - buildkite/dynamic-build-badges - Dynamic readme badges from your Buildkite build meta-data (others)
README
# Deprecated
> Buildkite no longer uses dynamic build badges. This repository is deprecated and is no longer maintained.
# Dynamic Build Badges ![](https://img.shields.io/badge/Woot-100%-green.svg?style=flat-square)
A dynamic build badge server that uses the [Buildkite Builds API](https://buildkite.com/docs/api/builds) and [shields.io](http://shields.io/) to turn any of your [build meta-data values](https://buildkite.com/docs/guides/build-meta-data) 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:
```bash
buildkite-agent meta-data set coverage '95%'
```To show the value from the last passing master build, you’d:
```html
```which would look like:
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](http://shields.io/#styles) (e.g. `flat-square`)
* `logo` - [shields.io logo](http://shields.io/#styles) (e.g. `data:image/png;base64,…`)
* `logoWidth` - [shields.io logoWidth](http://shields.io/#styles) (e.g. `40`)## Usage
1. **Create an API token**
Create a [Buildkite API Token](https://buildkite.com/user/api-access-tokens) 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…1. [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)
4. **Embeddinate your badges** :tada:
## Docker
You can also run this via Docker using [`buildkite/dynamic-build-badges`](https://hub.docker.com/r/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](https://github.com/badges/shields)## Development
* `git clone`
* `env BUILDKITE_API_KEY=xxx npm run web`## Contributing
Pull requests welcome!
## License
See the [License](License.md) file for license rights and limitations (MIT).