1

I have a Jenkins job which I want to trigger after deploying pipeline in Gitlab, Is this possible with webhooks or some other way?

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.

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.