简体   繁体   English

如何忽略Jenkins / HG中某个用户的更改?

[英]How do I ignore changes by a certain user in Jenkins/HG?

I'm using Jenkins with a HG repository. 我正在将Jenkins与HG存储库一起使用。 There is a post-build script that updates some files and pushes them to the repository. 有一个构建后脚本可以更新一些文件并将其推送到存储库。 Since Jenkins is set up to build on repo changes, the update triggers a rebuild in an infinite loop. 由于Jenkins设置为基于回购更改而构建,因此更新将在无限循环中触发重新生成。

Changing the directory structure to avoid this seems difficult, so I figured the best option would be to simply ignore changes made by the user "jenkins". 更改目录结构来避免这种情况似乎很困难,因此我认为最好的选择是忽略用户“ jenkins”所做的更改。

Is there a way to let Jenkins ignore changes by a certain user? 有没有办法让詹金斯忽略某些用户的更改?

Since I guess you don't want to push anything from you CI-server into the central repo, you can set up the default-push path of the clone that it points to itself. 由于我想您不想将任何CI服务器中的内容推送到中央存储库中,因此可以设置克隆指向其自身的默认推送路径。 So any push without an explicit given URL will target the clone and not the central repository. 因此,没有明确给定URL的任何推送都将针对克隆而不是中央存储库。

$ cat << EOF >> .hg/hgrc
[paths]
default-push = $PWD
EOF

$ hg ci -m'test'

$ hg push
pushing to /home/foo/bar
searching for changes
no changes found

$ hg push ../source
pushing to ../source
searching for changes
adding changesets
adding manifests
adding file changes
added 3 changesets with 3 changes to 1 files

$ hg pull
pulling from /home/foo/source
searching for changes
no changes found

See http://hgbook.red-bean.com/read/a-tour-of-mercurial-the-basics.html#id349161 for more details. 有关更多详细信息,请参见http://hgbook.red-bean.com/read/a-tour-of-mercurial-the-basics.html#id349161

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM