Teamcity在github上构建徽章 [英] Teamcity build badge on github

查看:127
本文介绍了Teamcity在github上构建徽章的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的github页面上添加一个teamcity构建徽章。我的存储库是一个私人github存储库。
我将以下代码作为开始链接说。

 < a href =http://teamcity/viewType.html?buildTypeId = myID& amp; amp; ;客人= 1\" > 
< / a>

当时我遇到的问题是图像被阻塞了。我怀疑这是因为我的teamcity服务器在http上,而我的github repo使用https。



在我的情况下,无法将teamcity更改为使用https,因此这不是一个选项。



任何有关如何在github上获取构建徽章的解决方法/建议? 解决方案

对于显示的用户页面,GitHub从服务器端检索图像,并用缓存的图像替换原始图像。这就是为什么,TeamCity实例应该可以在外部访问,并且状态图标应该可供任何用户使用:确保按照Boris的建议检查启用状态小部件的最简单方法。



图片也被GitHub非常积极地缓存,所以显示的徽章可能已过时。至少使用添加了HTTP标头的TeamCity 10.0.2,以防止该缓存。


I wanted to add a teamcity build badge on my github page.My repository is a private github repository. I started of by including the code below as the link said.

<a href="http://teamcity/viewType.html?buildTypeId=myID&guest=1"> 
<img src="http://teamcity/app/rest/builds/buildType(id:myID)/statusIcon"/>
</a>

The problem I got stuck at then,was that the image was being blocked.I suspected that this was because my teamcity server was on http while my github repo used https.

In my case it is not possible to change teamcity to use https and so this was not an option.

Any workarounds/suggestions for how to get my build badges on github?

解决方案

For the user pages displayed, GitHub retrieves the images from the server side and replaces the original image with the one cached. That is why, the TeamCity instance should be accessible externally and the status icon should be available to any user: the easiest way to ensure that is to check "enable status widget" as Boris suggested.

The image is also cached quite aggressively by GitHub, so the badge shown can be outdated. Use at least TeamCity 10.0.2 which has added HTTP headers trying to prevent that caching.

这篇关于Teamcity在github上构建徽章的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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