I have a Jenkins job which I want to trigger after deploying pipeline in Gitlab, Is this possible with webhooks or some other way?
2 Answers
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.
I would recommend using the 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