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

发布于 2024-12-05 06:19:20 字数 197 浏览 0 评论 0原文

我正在将 Jenkins 与 HG 存储库一起使用。有一个构建后脚本可以更新一些文件并将它们推送到存储库。由于 Jenkins 设置为基于存储库更改进行构建,因此更新会在无限循环中触发重建。

更改目录结构来避免这种情况似乎很困难,所以我认为最好的选择是简单地忽略用户“jenkins”所做的更改。

有没有办法让 Jenkins 忽略某个用户的更改?

I'm using Jenkins with a HG repository. 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.

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".

Is there a way to let Jenkins ignore changes by a certain user?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

韬韬不绝 2024-12-12 06:19:20

因为我猜你不想将 CI 服务器中的任何内容推送到中央存储库中,所以你可以设置它指向自身的克隆的默认推送路径。因此,任何没有明确给定 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

请参阅 http://hgbook.red- bean.com/read/a-tour-of-mercurial-the-basics.html#id349161 了解更多详细信息。

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. So any push without an explicit given URL will target the clone and not the central repository.

$ 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文