Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sgaunet/gobadger
Tool to generate badges (svg format). (To use in gitlab-ci)
https://github.com/sgaunet/gobadger
badge gitlab gitlab-ci
Last synced: 14 days ago
JSON representation
Tool to generate badges (svg format). (To use in gitlab-ci)
- Host: GitHub
- URL: https://github.com/sgaunet/gobadger
- Owner: sgaunet
- License: mit
- Created: 2022-10-16T11:11:24.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-31T12:09:57.000Z (5 months ago)
- Last Synced: 2024-07-31T15:28:11.624Z (5 months ago)
- Topics: badge, gitlab, gitlab-ci
- Language: Go
- Homepage:
- Size: 181 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![Go Report Card](https://goreportcard.com/badge/github.com/sgaunet/gobadger)](https://goreportcard.com/report/github.com/sgaunet/gobadger)
![CI](https://github.com/sgaunet/gobadger/actions/workflows/build.yml/badge.svg)
[![Maintainability](https://api.codeclimate.com/v1/badges/b816877e855ed6793bc1/maintainability)](https://codeclimate.com/github/sgaunet/gobadger/maintainability)
[![GitHub release](https://img.shields.io/github/release/sgaunet/gobadger.svg)](https://github.com/sgaunet/gobadger/releases/latest)
![GitHub Downloads](https://img.shields.io/github/downloads/sgaunet/gobadger/total)
[![GoDoc](https://godoc.org/github.com/sgaunet/gobadger?status.svg)](https://godoc.org/github.com/sgaunet/gobadger)
[![License](https://img.shields.io/github/license/sgaunet/gobadger.svg)]# gobadger
Tool to generate badge (svg format).
It has been created to be used for private gitlab repositories. The badge need to be an artifact. See below on how to do.# Usage
```
$ gobadger -h
Usage of gobadger:
-c string
color of badge (default "#5272B4")
-o string
output file name (default "badge.svg")
-t string
title
-v string
Value for the title
```# In gitlab ci :
Create a stage in the CI to create the badges. They have to be artifacts.
```
build_badges2:
stage: build
image: sgaunet/gobadger:latest # <= replace with the last tag
script:
# https://gitlab.com/%{project_path}/-/jobs/artifacts/main/raw/ref.svg?job=build_badges2
- gobadger -o ref.svg -t godoc -v reference
# https://gitlab.com/%{project_path}/-/jobs/artifacts/main/raw/badge.svg?job=build_badges2
- gobadger -o badge.svg -t title -v value -c "#00FF00"
artifacts:
name: badge.svg
paths:
- badge.svg
- ref.svg
expire_in: 2 days
```And add the badges in the project (settings > General > Badges ):
* Name: Name of the badge
* Link: Link of the button ex: https://gitlab.com/%{project_path}/-/commits/%{default_branch}
* Badge: https://gitlab.com/%{project_path}/-/jobs/artifacts/main/raw/badge.svg?job=build_badges2# Install
## In your docker image
```
FROM sgaunet/gobadger:latest AS buildFROM ...
COPY --from=build /usr/bin/gobadger /usr/bin/gobadger
```## Install the binary
```
curl -L -o gobadger https://github.com/sgaunet/gobadger/releases/download/v0.2.0/gobadger_0.2.0_linux_amd64
```