We have the Jenkins folder plugin. When a new folder is created, and 'Add an item' is selected, none of the projects from the containing Jenkins database are available to be copied in the 'copy from' selection. What's the easiest way to copy an existing Jenkins project into a new folder?
You need to specify the absolute path.
For example if you create folder
Util
And inside Util you want to copy job "FooJob" from the base level in "copy from" specify
/FooJob
Or of FooJob is inside folder Bar specify
/Bar/FooJob
The answer given by krtrego (use absolute paths) is correct -- but: you can also copy the job on filesystem level, which is preferable in many cases. That is, on Linux, do
cp -ar $JENKINS_HOME/jobs/jobXYZ $JENKINS_HOME/jobs/folderABC/jobs
Shutdown Jenkins beforehand and start it afterwards (or do not shutdown, and just "reload configuration from disk" afterwards).
Depending on the definition of "easy", this might be the best choice, since
Tagline: for anything but the most simple tasks, it will be good to avoid Folder Move/Copy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With