Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
How to trigger a remote build via a URL for a Jenkins job
  1. Create new user (e.g. webhook) with the following permissions: Overall > Read, Job > Build, Job > Read & Job > Workspace. Login as the user and get their API token
  2. Under a job, enable "Trigger Builds Remotely" and set an authentication token
  3. Trigger a POST request with the following structure:

http://{USER}:{API_TOKEN}@{JENKINS_URL}/job/{JOB}/build?token={AUTHENTICATION_TOKEN}

@ThinkerBoy

This comment has been minimized.

Show comment Hide comment
@ThinkerBoy

ThinkerBoy Jan 8, 2018

Thank you ,this is very userful

Thank you ,this is very userful

@kavalerchik

This comment has been minimized.

Show comment Hide comment
@kavalerchik

kavalerchik Jan 21, 2018

Where do I get the AUTHENTICATION_TOKEN from? The API_TOKEN I found under my user name (http://localhost:8080/user/admin/configure).
Should I just create my own in bullet 2 above?
Thanks

kavalerchik commented Jan 21, 2018

Where do I get the AUTHENTICATION_TOKEN from? The API_TOKEN I found under my user name (http://localhost:8080/user/admin/configure).
Should I just create my own in bullet 2 above?
Thanks

@a0s

This comment has been minimized.

Show comment Hide comment
@a0s

a0s Feb 17, 2018

How can i skip (disable) USER/API_TOKEN validation? Using AUTHENTICATION_TOKEN only is enough secure...

a0s commented Feb 17, 2018

How can i skip (disable) USER/API_TOKEN validation? Using AUTHENTICATION_TOKEN only is enough secure...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment