Karthick
Karthick

Reputation: 21

How to trigger and move to next stage in pipeline using Jenkins CLI?

I have three stages in my pipeline.

  1. Build
  2. Deploy
  3. Test

And i am going to trigger this pipeline remotely using jenkins CLI and then promote it to next stages based on need. Is there any CLI commands to trigger a pipeline to move to next stage?

Upvotes: 0

Views: 584

Answers (1)

hakamairi
hakamairi

Reputation: 4678

You can use input as the blocking part, like

stage {
    steps {
        //other steps, and finally the input
        input id: 'Input1', message: 'Deploy to Production?'
    }
}

For remotely triggering just do

https://[jenkins_base_URL]/job/[job_name]/[build_id]/input/Input1/proceedEmpty

If it would complain about crumb

https://MY_JENKINS_RUL/crumbIssuer/api/json

Upvotes: 1

Related Questions