Reputation: 4767
This question talks about batch renaming jobs in Hudson, but it only mentions modifying the config.xml file.
http://wiki.hudson-ci.org/display/HUDSON/Administering+Hudson says you can rename jobs by just renaming the directories they are in.
In my Hudson setup, I have many jobs tied together, and also use the Nested Views plugin which records the name of jobs in the master config.xml file.
It seems like the proper way to mass rename jobs is to rename the directory, then edit the master config.xml file, then the config.xml files in each job's directory. Is this right?
Upvotes: 3
Views: 597
Reputation: 9259
Directly editing config.xml files should work fine. Alternatively you may want to use Hudson's remote API.
Using the remote API, renaming a job would be a 2-step process:
Copy the job, using a POST to http://my-hudson-server/createItem?name=newJobName&mode=copy&from=oldJobName
Delete the old job, using a POST to http://my-hudson-server/job/oldJobName/doDelete
Take a look at http://my-hudson-server/api
for more detailed info on how to use the remote API.
Upvotes: 2
Reputation: 16615
Yes, this looks right.
Make sure Hudson is offline or "preparing for shutdown" and no affected jobs are running. Then restart or reload jobs from disk. An absolute must is to backup your configuration beforehand. A good idea is to create a copy of your configuration and test your changes there.
Upvotes: 1