Skip to content
/ badger Public

Dynamically render badges based on provided properties

License

Notifications You must be signed in to change notification settings

peppys/badger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

badger

Heavily inspired by:

Dynamically build badges based on specified properties

Maven installation

  1. Add the following to your global ~/.m2/settings.xml:
<profiles>
  <profile>
    <id>github</id>
      <repositories>
        <repository>
          <id>github</id>
          <name>peppys badger github repo</name>
          <url>https://maven.pkg.github.com/peppys/badger</url>
        </repository>
      </repositories>
  </profile>
</profiles>

<servers>
  <server>
    <id>github</id>
    <username>{GITHUB_USER}</username>
    <password>{GITHUB_TOKEN}</password>
  </server>
</servers>
  1. Add the following depency to your pom.xml
<dependency>
  <groupId>io.github.peppys</groupId>
  <artifactId>badger</artifactId>
  <version>0.0.5</version>
</dependency>
  1. Run via command line
$ mvn install

Usage

import io.github.peppys.badger.Badge;

Badge badge = Badge.builder()
        .setLabelText("build")
        .setLabelColor("black")
        .setMessageText("passing")
        .setMessageColor("green")
        .build();

String svg = badge.render()

Local setup

  1. Run API
$ docker-compose up api
  1. Render via endpoint
$ curl -X GET "http://localhost:8080/badge.svg?label_text=build&label_color=black&message_text=passing&message_color=green"

Demo

Demo URL: https://badger-oxm27jqbha-uc.a.run.app/badge.svg?label_text=demo&label_color=black&message_text=hello%20world&message_color=green

Demo Badge:

About

Dynamically render badges based on provided properties

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages