Reputation: 3562
I have website that is generated from a single github repository with two distinct folders source (templates, markdown and assets) and site (html and assets). I have set up a github webhook for the push event that triggers a pull, a build and a push of the generated site back to the same github repo, but only if the id of the head commit (from the webhook payload) is different from the rev-parse'd HEAD on the server. This prevents a recursive loop, and everything works (for now).
However I am worried about a possibility of an endless loop and am looking for a more robust solution. Unfortunately, due to extraneous reasons, I dont have the choice of working with two separate repos for source and site.
Is there a solution that I could have this remote build feature in a single source+site repo?
Thank you.
Upvotes: 0
Views: 352
Reputation: 13104
A common solution for this is to have a special marker in the commit message for commits that should not trigger the build process. For example, the commit with a new build of the site might be "[ci skip] Site Rebuilt".
For travis ci, as long as the commit includes "[ci skip]" it will not build it. In jenkins, this can be used with the "Polling Ignores Commits with Certain Messages" setting for polling git. Bamboo has an "Exclude Changesets" configuration that can be configured to exclude commit messages.
Upvotes: 1