In this tutorial, How to Import Export jobs, Jenkins. It is easy to import and export Jenkins job and plugin when you migrating Jenkins jobs to a new server. I use Butler CLI. Jenkins the essential for DevOps Roles.
To get butler package for your system Linux. Link butler download.
For Linux
wget https://s3.us-east-1.amazonaws.com/butlercli/1.0.0/linux/butler chmod +x butler mv butler /usr/local/bin/
To verify the Bulter
/usr/local/bin/butler help
Import Export Jobs Jenkins
OLD SERVER
To export Jenkins plugins
/usr/local/bin/butler plugins export --server localhost:8080 --username admin --password admin
Butler will dump a list of plugins installed to new file “plugins.txt”
To export Jenkins jobs
/usr/local/bin/butler jobs export --server localhost:8080 --username admin --password admin
A new directory “jobs” will be created with every job in Jenkins. Each job it owns configure file config.xml
NEW SERVER
To import Jenkins plugins
/usr/local/bin/butler plugins import --server localhost:8080 --username admin --password admin
To import Jenkins jobs
/usr/local/bin/butler jobs import --server localhost:8080 --username admin --password admin
Another method, you can refer to from StackOverflow
- Jenkins CLI
- Copy the jobs directory
- Jenkins Remote API
- Jenkins Job Import Plugin
Conclusion
Thought the article, you can use “Import Export Jobs Jenkins” as above. I hope will this your helpful. Thank you for reading the DevopsRoles page!
I have noticed you don’t monetize devopsroles.com, don’t
waste your traffic, you can earn additional bucks every month with new monetization method.
This is the best adsense alternative for any type of website
(they approve all websites), for more info simply search
in gooogle: murgrabia’s tools