trigger Jenkins build on git commit without using hook

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

trigger Jenkins build on git commit without using hook

pulkitlall
Hi,
We have a internal enterprise git repo (not github) which has many branches. I want Jenkins to trigger a build once checkin is made to git repo but I do not want to use git hooks.
I would like to know if there is any other way to trigger Jenkins build on git commit without using hooks.

TIA

Regards,
Pulkit Lall

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/8be38972-1c00-4cf8-8e33-abca09883cea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: trigger Jenkins build on git commit without using hook

pulkitlall
Also would not like to use time in polling (Sorry, forgot to add in original post)

On Monday, 27 November 2017 09:53:48 UTC+5:30, Pulkit Lall wrote:
Hi,
We have a internal enterprise git repo (not github) which has many branches. I want Jenkins to trigger a build once checkin is made to git repo but I do not want to use git hooks.
I would like to know if there is any other way to trigger Jenkins build on git commit without using hooks.

TIA

Regards,
Pulkit Lall

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1a39bd1b-8236-462d-a28e-d77551d74f20%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: trigger Jenkins build on git commit without using hook

Mark Waite-2
Can you explain why you don't want to use "hooks"?

Is your objection to webhooks (as used by github, bitbucket, gitea and others) or to repository hook scripts (like post-receive)?

The "polling must die" blog post from Kohsuke explains why the /git/notifyCommit technique is better than polling.  However, it is generally implemented as a post-receive hook in the git repository.  The post-receive hook script is called when commits are pushed to the repository.

Mark Waite

On Sun, Nov 26, 2017 at 9:34 PM 'Pulkit Lall' via Jenkins Users <[hidden email]> wrote:
Also would not like to use time in polling (Sorry, forgot to add in original post)


On Monday, 27 November 2017 09:53:48 UTC+5:30, Pulkit Lall wrote:
Hi,
We have a internal enterprise git repo (not github) which has many branches. I want Jenkins to trigger a build once checkin is made to git repo but I do not want to use git hooks.
I would like to know if there is any other way to trigger Jenkins build on git commit without using hooks.

TIA

Regards,
Pulkit Lall

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1a39bd1b-8236-462d-a28e-d77551d74f20%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtHu%3DzcGedjqbMhh9d2WDqzdehDsw%3DG_q_MxOKY1DdOhGQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: trigger Jenkins build on git commit without using hook

pulkitlall
Hi Mark,
Thank you for replying.

I am not against not using "hooks" but I do not want to update git repo and thus thought if there is a way to trigger Jenkins build on git commit without using hooks.
If there is no alternative then I will have to use git hooks.

Pulkit Lall

On Monday, 27 November 2017 10:19:27 UTC+5:30, Mark Waite wrote:
Can you explain why you don't want to use "hooks"?

Is your objection to webhooks (as used by github, bitbucket, gitea and others) or to repository hook scripts (like post-receive)?

The "polling must die" blog post from Kohsuke explains why the /git/notifyCommit technique is better than polling.  However, it is generally implemented as a post-receive hook in the git repository.  The post-receive hook script is called when commits are pushed to the repository.

Mark Waite

On Sun, Nov 26, 2017 at 9:34 PM 'Pulkit Lall' via Jenkins Users <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="d4hdqC2aBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkins...@googlegroups.com> wrote:
Also would not like to use time in polling (Sorry, forgot to add in original post)


On Monday, 27 November 2017 09:53:48 UTC+5:30, Pulkit Lall wrote:
Hi,
We have a internal enterprise git repo (not github) which has many branches. I want Jenkins to trigger a build once checkin is made to git repo but I do not want to use git hooks.
I would like to know if there is any other way to trigger Jenkins build on git commit without using hooks.

TIA

Regards,
Pulkit Lall

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="d4hdqC2aBQAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/1a39bd1b-8236-462d-a28e-d77551d74f20%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/1a39bd1b-8236-462d-a28e-d77551d74f20%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/1a39bd1b-8236-462d-a28e-d77551d74f20%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/1a39bd1b-8236-462d-a28e-d77551d74f20%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/691cd1fc-d3fe-419d-9fe8-68db0f85c1b6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: trigger Jenkins build on git commit without using hook

pulkitlall
I am able to trigger Jenkins job using git commit hook and now want to trigger Jenkins job with git commit for specific branch.
e.g. In my multi-configuration job, we have repo, branch, version, etc parameters.

Is there a way, we can trigger Jenkins job on git commit and supply the parameters to job.

I tried to add the following in post-commit hook, but did not work:
curl -X POST http://server/job/Test/build \
  --user USERNAME:PASSWORD \
  --form json='{"parameter": [{"PARAMETER_NAME_IN_JENKINS_JOB":"VALUE"]}'

TIA


On Monday, 27 November 2017 10:27:54 UTC+5:30, Pulkit Lall wrote:
Hi Mark,
Thank you for replying.

I am not against not using "hooks" but I do not want to update git repo and thus thought if there is a way to trigger Jenkins build on git commit without using hooks.
If there is no alternative then I will have to use git hooks.

Pulkit Lall

On Monday, 27 November 2017 10:19:27 UTC+5:30, Mark Waite wrote:
Can you explain why you don't want to use "hooks"?

Is your objection to webhooks (as used by github, bitbucket, gitea and others) or to repository hook scripts (like post-receive)?

The "polling must die" blog post from Kohsuke explains why the /git/notifyCommit technique is better than polling.  However, it is generally implemented as a post-receive hook in the git repository.  The post-receive hook script is called when commits are pushed to the repository.

Mark Waite

On Sun, Nov 26, 2017 at 9:34 PM 'Pulkit Lall' via Jenkins Users <[hidden email]> wrote:
Also would not like to use time in polling (Sorry, forgot to add in original post)


On Monday, 27 November 2017 09:53:48 UTC+5:30, Pulkit Lall wrote:
Hi,
We have a internal enterprise git repo (not github) which has many branches. I want Jenkins to trigger a build once checkin is made to git repo but I do not want to use git hooks.
I would like to know if there is any other way to trigger Jenkins build on git commit without using hooks.

TIA

Regards,
Pulkit Lall

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/jenkinsci-users/1a39bd1b-8236-462d-a28e-d77551d74f20%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/1a39bd1b-8236-462d-a28e-d77551d74f20%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/jenkinsci-users/1a39bd1b-8236-462d-a28e-d77551d74f20%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/jenkinsci-users/1a39bd1b-8236-462d-a28e-d77551d74f20%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e2ec93ea-62c7-4446-bb35-d00b14fb67c6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.