How to set a Mercurial VCS build trigger for TeamCity that ignores label operations

感情迁移 提交于 2019-12-17 18:24:40

问题


I am trying to setup a build trigger for TeamCity using Mercurial as the VCS. Right now the trigger looks like:

+:/**

This trigger get fired when changesets are committed. However, I have TeamCity setup to tag each build in the VCS. The tagging process is firing the above build trigger so the build gets caught in a loop.

Can anyone suggest a VCS build trigger that will filter out the tagging process?


回答1:


Adding the trigger pattern:

-:/.hgtags

filters out the .hgtags file from the build trigger. This is the file that gets modified when the source is tagged by TeamCity. When this file is excluded tagging operations will not fire the build trigger.




回答2:


Teamcity and the syntax above are foreign to me, but if you've got scripting capabilities you can check if a changeset is a tag-only changeset by doing something like this:

if [ "$(hg log -r tip --template '{files}')" = '.hgtags' ]; then
    echo tag only
else
    echo other stuff too
fi

Just swap out tip for whatever changeset you're about to act on, and change the echo statements to an exit, a make, or a hg tag as appropriate to either skip the build or just skip the creating of a new tag if the last changeset was only a tag.



来源:https://stackoverflow.com/questions/1478297/how-to-set-a-mercurial-vcs-build-trigger-for-teamcity-that-ignores-label-operati

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!