Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Jenkins, how do you rename a job using the CLI?

I've been reading this wiki article about the Jenkins CLI. Is there a way to rename a job through the CLI? I can't seem to find a way. An obvious workaround would be to copy a job then delete the old one, but I'm hoping there's a more straight forward way.

like image 572
Daniel Kaplan Avatar asked Nov 02 '22 11:11

Daniel Kaplan


1 Answers

For what it's worth, I had to rename a larger number of jobs and was hoping on the CLI. There is no dedicated rename command. I did not try to get-job and then push a changed version up again, maybe that would work.

I have no direct access to the Jenkins machine and thus cannot mess around on the file system, like some suggested.

I resorted to a manual approach, with some clicking - maybe this is viable workaround for others: https://.../jenkins/job/OLD-JOB-NAME/rename?newName=NEW-JOB-NAME - this will give you a "are you sure" prompt, which after confirming should rename the job.

like image 111
JanDasWiesel Avatar answered Nov 09 '22 10:11

JanDasWiesel