Skip to content

A simple Firebase webservice to create badges/shields for your CI.

License

Notifications You must be signed in to change notification settings

OhMyApp/FireBadge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FireBadge

A simple Firebase webservice to create badges/shields for your CI like:

Badge Status

You can create as many badges as needed for a project.

Ex: build, test, deploy, ...

And customize left label, right label, right color.

Stack

Setup

  1. Create a Firebase project.

  2. Import rules and cloud functions from this project:

  • firestore.rules
  • functions/src/index.ts
  1. Open Firebase console/Firestore to create :
  • a collection named projects
  • a project document with a single token string property

The path looks like: projects/{project_id}

project_id: you should choose a human readable name.

token: fill it with a random key, it will be required to create a badge.

Structure

Project model

token: string

Badge model

label: string
color: string

Badges are stored under a project document:

projects/{project_id}/badges/{badge_id}

How to use

Create or update a badge

Call route setBadge with these parameters:

  • project: name
  • badge: left text
  • label: right text
  • color: an english color name (green, red, orange, brightgreen, ...)
  • token: the key to get a write permission
https://xxx.cloudfunctions.net/setBadge?project=skyrocket&badge=launch&label=success&color=green&token=yolo

Get a badge image

Call route getBadge with these parameters:

  • project: name
  • badge: left text
https://xxx.cloudfunctions.net/getBadge?project=skyrocket&badge=launch

Badge Status

Markdown

![Build Status](https://xxx.cloudfunctions.net/getBadge?project=skyrocket&badge=build)

Continuous Integration tool

Add a simple bash script step with a curl command:

curl "https://xxx.cloudfunctions.net/setBadge?project=skyrocket&badge=deploy&label=moon&color=blue"

Contributing

Contributions are welcome. Please open up an issue in GitHub or submit a PR.

Acknowledgements

Thanks to https://shields.io/ for their public image generator.

Thanks to Firebase for their free backend. https://firebase.google.com/

About

A simple Firebase webservice to create badges/shields for your CI.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages