Rohan Kankapurkar
Rohan Kankapurkar

Reputation: 125

Is there a way to trigger a Jenkins job from "execute shell" of another Jenkins job?

I have three Jenkins jobs. The first job has "execute bash" as a build step. The bash script has if/else statement. And based on this if/else I need to trigger the other two jobs. Is there a way in the "execute shell" to trigger other jobs?

Upvotes: 5

Views: 9888

Answers (1)

mainframer
mainframer

Reputation: 22089

Inside the Execute Shell , you can execute any shell command (including curl). You can trigger an existing job with curl. e.g. curl -X POST http://xx.xx.xx.xx:xx/job/jobname/build --user foo:foo_token

Upvotes: 7

Related Questions