0

As far as I understand, using the Linux CLI, builds can be triggered remotely using the curl command and the following URL syntax:

<JENKINS_URL>/job/<JOB_NAME>/build?token=<TOKEN_NAME>

Example:

$ curl http://localhost:8080/job/MyJob/build?token=my-token

However, when I run the command, I receive the following:

Authentication required
<!--
-->
</body></html>

Is authentication done using the CLI or the Jenkins web interface? How do I authenticate?

1 Answer 1

1

This is covered in the documentation. In short, if you are triggering via HTTP, you need to generate an authentication token and use it with HTTP Basic auth, for instance:

curl -X POST -L --user your-user-name:apiToken https://jenkins.example.com/job/your_job/build

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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