如何在gitlab中创建存储库徽章? [英] How to create repository badges in gitlab?

查看:158
本文介绍了如何在gitlab中创建存储库徽章?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在gitlab中为我的项目创建徽章?

How do I create badges for my project in gitlab?

我知道这里有一个网页 https://docs.gitlab .com/ee/user/project/badges.html

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.

假设我的项目在这里 https://gitlab.com/username/userproject

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

链接和徽章图片链接应该是什么?

what should be the link and the badge image link?

推荐答案

有两个默认标志:管道"和覆盖". 示例网址为:

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

  • 对于管道,您必须设置一个构建服务器管道(.gitlab-ci.yml).
  • 要进行覆盖,您必须在CI的设置中输入一个正则表达式解析表达式.
  • 但是您也可以设置自定义徽章.但是您必须自己创建它们. 对于公共回购,您可以使用 Shields.io 之类的服务;对于私人回购,您可以使用将自定义徽章添加到Gitlab

    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.

    这篇关于如何在gitlab中创建存储库徽章?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆