DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Save/Restore Jenkins Jobs


  1. Add client credentials to Jenkins server:

    i. Create public key of client machine use ssh-keygen if it doesn't exist, see note " Login SSH Server without Password " for details;

    i. open "http://10.0.2.74:8088/me/configure";

    i. Add "SSH Username with password" in Credentials section with username and password of the client machine;

    i. In "SSH Public Keys", add all content in ~/.ssh/id_rsa.pub on client machine;

Verify credentials with java -jar jenkins-cli.jar -s http://10.0.2.74:8088/ who-am-i;

Ref: Section "Working with Credentials" in https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+CLI

  1. Save Jenkins jobs in xml files:

On client machine: java -jar jenkins-cli.jar -s http://10.0.2.74:8088/ get-job ESB > ESB_jenkins.xml

  1. Restore Jenkins jobs from xml files:

On client machine: java -jar jenkins-cli.jar -s http://10.0.2.74:8088/ create-job ESB < ESB_jenkins.xml;

Ref:

http://stackoverflow.com/questions/8424228/export-import-jobs-in-jenkins



Published

Jul 16, 2013

Last Updated

Jul 16, 2013

Category

Tech

Tags

  • jenkins 26

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor