Delete-builds via jenkins-cli when jobs are organized by CloudBees Folder Plugin

387 views
Skip to first unread message

Ramón Manjavacas Ortiz

unread,
Jun 23, 2014, 3:03:51 PM6/23/14
to jenkins...@googlegroups.com
Hi,

   I'm trying to delete a range of builds via jenkins-cli.jar and the jobs are organized in folders via the CloudBees Folder Plugin. For example: folder1/job1.

   The command line is: java -jar jenkins-cli.jar -s http://<server>/jenkins delete-builds <jobName> '10-100' --username xxxx --password yyyy

   My question is how to set a well-formed 'job name',  I've got  the message 'No such job...' when it's used 'job1' or 'folder1/job1'

  Any suggestion?

Thanks,
Ramón Manjavacas

Jonathan Álvarez

unread,
Jan 25, 2016, 8:33:15 AM1/25/16
to Jenkins Users, rmanj...@jccm.es
Hi Ramón,

I have tried with one example.
Let´s assume that we have a job "testtest" inside  a first level "job_folder_test" folder and inside a second level "sub_folder_item name" folder. Please, notice that the name of this folder has a space.
I used the following command to delete the jobs 1 and 2.
java -jar ~/.jenkins/jenkins-cli.jar -s http://localhost:9090 delete-builds 'job_folder_test/sub_folder_item name/testtest' '1-2'

Again notice that i put the folder path within commas so that the space is recognized.
I hope it helps
Best regards,
Jonathan 
Reply all
Reply to author
Forward
0 new messages