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?
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.