Heavily inspired by:
- https://github.com/badges/shields
- https://github.com/HandOfGod94/jacoco-cov-badge-maven-plugin
Dynamically build badges based on specified properties
- 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>
- Add the following depency to your
pom.xml
<dependency>
<groupId>io.github.peppys</groupId>
<artifactId>badger</artifactId>
<version>0.0.5</version>
</dependency>
- Run via command line
$ mvn install
import io.github.peppys.badger.Badge;
Badge badge = Badge.builder()
.setLabelText("build")
.setLabelColor("black")
.setMessageText("passing")
.setMessageColor("green")
.build();
String svg = badge.render()
- Run API
$ docker-compose up api
- Render via endpoint
$ curl -X GET "http://localhost:8080/badge.svg?label_text=build&label_color=black&message_text=passing&message_color=green"