From Trivial Bongo, 4 Days ago, written in Text.
Embed
  1. Obtain the config.xml representing the a-seed-job.
  2.  
  3. $ scp aashraf@blxblddev2.transunion.ca:/var/lib/jenkins/jobs/a-seed-job/config.xml .
  4.  
  5. $ username=admin
  6.  
  7. $ password=4723ea45b813558f57b5fb14e9dddf74 http://blxblddev2.transunion.ca:8080/user/admin/configure
  8.  
  9. CRUMB=$(curl -u $username:$password -s 'http://blxblddev2.transunion.ca:8080/crumbIssuer/api/xml?xpath=concat(//crumbRequestField,":",//crumb)')
  10.  
  11. curl -u $username:$password -H "$CRUMB" -s -XPOST 'http://blxblddev2.transunion.ca:8080/createItem?name=a-seed-job-new' --data-binary @config.xml -H "Content-Type:text/xml"
  12.  
  13. Notice, we are using name=a-seed-job-new. This new job will now appear in Jenkins.