How to wait for build to finish when triggering from CLI?

Issue

How to wait for build to finish when triggering via Jenkins CLI ( jenkins-cli.jar)?

Environment

  • CloudBees Jenkins Enterprise
  • Jenkins
  • Jenkins CLI

Resolution

Add the -s parameter to the build command:

java -jar jenkins-cli.jar -s http://localhost:8000 build "my-job" -s

Replace http://localhost:8000 with your Jenkins URL and my-job with your job name.

Authentication is not included in this example for brevity.

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.