Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThinkerBoy/2d8a5d3dfaf868c6822c292535967f99 to your computer and use it in GitHub Desktop.
Save ThinkerBoy/2d8a5d3dfaf868c6822c292535967f99 to your computer and use it in GitHub Desktop.
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}

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