Answers: <p>I just played with it locally on a "safe network", but it may give you an idea.</p>
  
  <p>I put in <code>.git/hooks/post-commit</code> something like:</p>
  
  <pre><code>wget --auth-no-challenge --http-user=$USER --http-password=$APITOKEN --secure-protocol=TLSv1 $JENKINS/job/$JOB/build?token=$JOBTOKEN -O /dev/null -o /dev/null
  </code></pre>
  
  <p>You need to create API token in jenkins and grab the webhook url for a given job. </p>
  
Answers: CC BY-SA 4.0
Answers: 2018-11-14T21:04:00.843Z
Answers: 2018-11-14T21:04:00.843Z
Answers: petrchpetr
Answers: <p>I would recommend using the <a href="https://plugins.jenkins.io/generic-webhook-trigger" rel="nofollow noreferrer">Generic Webhook Trigger</a> plugin. </p>
  
  <p>You can see a full example with complete Jenkins setup here: <a href="https://github.com/github/platform-samples/tree/master/hooks/jenkins/master-branch-protect" rel="nofollow noreferrer">https://github.com/github/platform-samples/tree/master/hooks/jenkins/master-branch-protect</a></p>
  
Answers: CC BY-SA 4.0
Answers: 2018-11-15T03:49:41.643Z
Answers: 2018-11-15T03:49:41.643Z
Answers: primetheus
Body: <p>I have a Jenkins job which I want to trigger after deploying pipeline in Gitlab, Is this possible with webhooks or some other way?</p>
  
Tags: <jenkins><gitlab>
Title: How to trigger Jenkins job by deploying git pipline using webhook?
UserDisplayName: Ema
ThreadText: # How to trigger Jenkins job by deploying git pipline using webhook?
  
  (Asked by: username_0 on 2018-11-14)
  
  I have a Jenkins job which I want to trigger after deploying pipeline in Gitlab, Is this possible with webhooks or some other way?
  
  **Tags:** jenkins, gitlab
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2018-11-14. Score: 1
  
  I just played with it locally on a "safe network", but it may give you an idea.
  
  I put in `.git/hooks/post-commit` something like:
  
  ```
  wget --auth-no-challenge --http-user=$USER --http-password=$APITOKEN --secure-protocol=TLSv1 $JENKINS/job/$JOB/build?token=$JOBTOKEN -O /dev/null -o /dev/null
  
  ```
  
  You need to create API token in jenkins and grab the webhook url for a given job.
  
  
  ---
  
  ### Answer by username_2 on 2018-11-15. Score: 0
  
  I would recommend using the [Generic Webhook Trigger](https://plugins.jenkins.io/generic-webhook-trigger) plugin.
  
  You can see a full example with complete Jenkins setup here: <https://github.com/github/platform-samples/tree/master/hooks/jenkins/master-branch-protect>
  
  
  ---
  
  