If you have multiple jenkins instances, there might be a requirement to export an existing jenkins job, that could be further imported into the newer jenkins instance.
We will learn how to do the export/import of jenkins job using jenkins cli.
We will learn how to do the export/import of jenkins job using jenkins cli.
How to Export existing Jenkins job.
- Jenkins Home Page
- Manage Jenkins
- Jenkins CLI.
- Download jenkins-cli.jar
- Click on Jenkins CLI.

Once file "jenkins-cli.jar" file has been downloaded, we are ready to export our Jenkins job, lets do it.
Open your terminal and run the below commands.
Authenticate and List down your jobs to identify the one, which one you want to export, replace "your-jenkins-server-url:your_server_port" from your source jenkins server's url and port.
cyberkeeda@jenkins-master:~$ java -jar jenkins-cli.jar -s "http://your-jenkins-server-url:your_server_port" -auth UserName:Password list-jobs djpass-ansible djpass-docker-app docker ps
Now, from above enlisted jobs i want to export the one named as "djpass-docker-app".
Run the below command and replace the highlighted one by yours.
cyberkeeda@jenkins-master:~$ java -jar jenkins-cli.jar -s "http://your-jenkins-server-url:your_server_port" -auth UserName:Password get-job djpass-docker-app > djpass-docker-app.xml
We have successfully exported our jenkins job named as "djpass-docker-app" as an xml file named as "djpass-docker-app.xml"
How to import Jenkins job to different Jenkins server.
- Go to your new jenkins server dashboard, where you want to import.
- Follow the same above steps to download the jenkins-cli.jar file.
- Ensure you are ready with "jenkins-cli.jar" and your exported jenkins job XML file with you.
Now run the below command to import your jenkins job xml file to new jenkins server.
Note : Replace the highlighted one by yours.
Preview:
cyberkeeda@jenkins-slave:~$ java -jar jenkins-cli.jar -s "http://your-Newjenkins-server-url:your_server_port" -auth UserName:Password create-job new-djpass-docker-app < djpass-docker-app.xml
Hoah !!! Thats it, check your dashboard to verify the same.
Nice blog!! I hope you will share more info like this. I will use this for my studies and research.
ReplyDeleteDevOps Training in Chennai
DevOps foundation certification
DevOps certification
AWS Training in Chennai
Cloud Computing Training in Chennai
Data Science Training in Chennai
DevOps Training in Anna Nagar
DevOps Training in Vadapalani
DevOps Training in Guindy
DevOps Training in Thiruvanmiyur
Enjoyed reading the article above, really explains everything in detail, the article is very interesting and effective. Thank you and good luck for the upcoming articles Python course
ReplyDeleteAsk relatives and friends about jobs where they work. Ask every relative and friend you have now or have ever had about vacancies they may know about where they work, or where anyone else works.Hr recruitment Companies in India
ReplyDeleteTitles should be industry-specific and familiar to job seekers since they will use keyword search for positions according to standard job titles. The Job Title field is not the field to market the job posting (like with a classified ad).How to Make cover letter
ReplyDeleteEvery job contributes to that career in some manner, even if the job offers nothing new or challenging and confirms that a person is ready to find new employment or a new occupation. ashamed of being unemployed
ReplyDeleteI read that Post and got it fine and informative. https://europa-road.eu/hu/alacsony-gepszallitas-arak.php
ReplyDeleteI’ve read some good stuff here. Definitely worth bookmarking for revisiting. I surprise how much effort you put to create such a great informative website. Europa-Road targonca szállítás Debrecen
ReplyDeleteIt's rare all around educated individuals in this specific point, yet you sound like you hear what you're saying! Much obliged
ReplyDeleteearthcycle
Very nice article. I enjoyed reading your post. very nice share. I want to twit this to my followers. Thanks !. good morning messages for him
ReplyDeleteThanks for sharing this article. I think You put a great deal of exertion to make this article. I like your work. Unique Dofollow Backlinks
ReplyDeletePretty nice post. I just stumbled upon your weblog and wanted to say that I have really enjoyed browsing your blog posts. After all I’ll be subscribing to your feed and I hope you write again soon! Shipping Container
ReplyDeleteWriting in all Caps, utilizing unnecessary interjection focuses, or adding abbreviations and contractions will decrease the believability of the job posting and possibly bring about job cancellation by the facilitating job board. https://europa-road.eu/hu/foldmunkagep-szallitas-debrecen.php
ReplyDeleteSecond hand gold buyers in Bangalore
ReplyDeleteMaximum Cash
We are the only company
of our kind to offer you up to ₹10,000 extra on selling your gold and other precious metals.
Door-Step Services
Second Hand Gold Buyers in Bangalore provide door-step services if you’re unable to visit our office. Contact us today to book an appointment.
Business Consultation
We offer business consultation for all types of industries. Old Gold Buyers in Bangalore help you to become more efficient in your sector.
Franchise Opportunity
We guarantee a return of 38% to 45% annually on becoming our franchisee.
https://prismleadindia.com/gold-buyers-in-bangalore/
your article is good thank you.
ReplyDeleteprism lead india is best business listing company for CA service, Modular Kitchen Design, Painting, Packers and movers, Event Organizer. we provide good services
Commercial Interior Designer Bangalore
Interior designers in Bangalore
tv repair service near me
refrigerator repairing near me/
These penthouses have some additional luxury features in them when compared to other units in the same apartment building. Some features include private elevators, a swimming pool, and many more.
ReplyDeleteThat depends upon your preferences and the size of the family. If you are single or have a small family, an apartment is a better choice for you. Plus, apartments are quick to flip if you decide to sell them and gain profit.
ReplyDelete