您可以使用 TeamCity REST API 来获取构建更改,例如:
curl /httpAuth/app/rest/changes?build=id:%teamcity.build.id%
作为命令行构建步骤将产生如下内容:
<changes count="3">
<change href="/httpAuth/app/rest/changes/id:217404" id="217404" version="b6b97a0d7789d97df6df908ab582ebb723235f43" webLink="http://teamcity.my-domain.com/viewModification.html?modId=217404&personal=false"/>
<change href="/httpAuth/app/rest/changes/id:217403" id="217403" version="064ecef5552ec2fb7875d7c26fe54cdf94b67bec" webLink="http://teamcity.my-domain.com/viewModification.html?modId=217403&personal=false"/>
<change href="/httpAuth/app/rest/changes/id:217402" id="217402" version="9bc3a34c952059bbfc7bebeb79ba5a3c894ef555" webLink="http://teamcity.my-domain.com/viewModification.html?modId=217402&personal=false"/>
</changes>
然后你可以遍历更改并点击它href
,这将产生如下:
<change date="20130918T133404-0600" username="welsh" href="/httpAuth/app/rest/changes/id:217397" id="217397" version="51e925e354a83deccde881b30a76974b2ff745f4" webLink="http://teamcity.my-domain.com/viewModification.html?modId=217397&personal=false">
<comment>
My comments are here
</comment>
<files>
<file before-revision="90acd4da1972814094c22e3020c5073521a7b640@141323126c0" after-revision="51e925e354a83deccde881b30a76974b2ff745f4@1413290abe0" file="grails-app/views/layouts/global.gsp" relative-file="grails-app/views/layouts/global.gsp"/>
</files>
<user href="/httpAuth/app/rest/users/id:1" id="1" name="Welsh" username="welsh"/>
</change>
然后您可以创建一些东西来获取此信息以将其推送到您的媒体 wiki。