问题
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?
回答1:
Make sure to check "enable status widget" checkbox on the General Setting page:
回答2:
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.
来源:https://stackoverflow.com/questions/39548247/teamcity-build-badge-on-github