Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create repository badges in gitlab?

How do I create badges for my project in gitlab?

I know there is a webpage for it here https://docs.gitlab.com/ee/user/project/badges.html

but I have no idea what they are saying.

suppose my project is here https://gitlab.com/username/userproject

what should be the link and the badge image link?

like image 560
trial guy Avatar asked May 30 '18 13:05

trial guy


People also ask

How do I create a custom badge in Gitlab?

Go to project Settings > General> Badges and add URL link and image URL click on Add Badge and it will be available on your project page.

What badges are available in Gitlab?

By default, Gitlab supports only two types of badges: pipeline and test coverage.


1 Answers

There are two default badges: Pipeline and Coverage. The example URLs would be:

https://gitlab.com/username/userproject/badges/master/pipeline.svg https://gitlab.com/username/userproject/badges/master/coverage.svg 
  • For pipeline you have to set up a buildserver pipeline (.gitlab-ci.yml).
  • For coverage you have to enter a regex parsing expression in the settings for CI.

But you can also set up custom badges. But you have to create them on your own. For public repos you can use an service like Shields.io or private repos you can use AnyBadge (needs an python interpreter in build chain. Here is an example how to set up a custom badge: Adding Custom badges to Gitlab

When you look at bigger repositories (for example this), you can have a look at the path of the images and see where they are created.

like image 51
Sir2B Avatar answered Oct 01 '22 13:10

Sir2B