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

查看:15
本文介绍了如何在 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

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

what should be the link and the badge image link?

推荐答案

有两个默认标记:Pipeline 和 Coverage.示例 URL 为:

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 之类的服务,也可以使用私有存储库 AnyBadge (在构建链中需要一个 python 解释器.以下是如何设置自定义徽章的示例:将自定义徽章添加到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

    当您查看更大的存储库时(例如 this),您可以看看在图像的路径上,看看它们是在哪里创建的.

    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天全站免登陆