2

To trigger a job remotely via script: Jenkins provides two mechanisms.

One is Jenkins generated Crumb - common for all jobs.

Other option is manually created Authentication Token - can be unique for all jobs.

Which of these two option is preferred and why?

Devharsh Trivedi
  • 561
  • 8
  • 23

1 Answers1

3

By itself - none.

The crumb is used to prohibit CSRF attacks, and is no mean by which to trigger a job remotely. A token can be considered an additional password for certain jobs, and if set, needs to be passed when triggering that job.

You can trigger a job remotely by using the Remote API, which boils down to a HTTP request. There surely are other means, e.g. the Parameterized Remote Trigger Plugin etc.

Stefan Hanke
  • 3,458
  • 2
  • 30
  • 34