Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to export and import "build step" in Jenkins?

Tags:

jenkins

How do I import and export "Build Step"?

I know "copy from another job", but I want export build step only. And this makes copy only. I also google this, but its job move: move Hudson job to another server

I want this, because I want others to review on my build step. Some text format is exist? My build step contains several ant, several script of shell.

like image 651
Matt - sanemat Avatar asked Oct 04 '11 09:10

Matt - sanemat


People also ask

How do I export Jenkins pipeline?

Create a project on JenkinsEnter function-export-example as name, select Pipeline , and click OK . In the newly created project, click Configure to set up. In the Pipeline section, select Pipeline script from SCM as Definition , Git as SCM , and your repo url as Repository URL . Click Save at the bottom.

Can you export a Jenkins configuration?

Export the Existing ConfigurationExport the current configuration into Jenkins. yaml, click the Export Configuration button to download the Jenkins. yaml file.


2 Answers

If your build is becoming that complicated, I think it is a sign that there is much knowledge about the build in the CI system that should really be refactored and put in the repository instead.

Try to keep the CI configuration to a minimum. Make sure the repository contains all the knowledge about how to do a proper build.

If you really want to extract parts of job configuration in Jenkins, the API does not seem to help. You might get what you want by picking up the job configuration file at http://[jenkinshost]/job/[jobname]/config.xml.

like image 139
Anders Lindahl Avatar answered Nov 04 '22 19:11

Anders Lindahl


You can also try to use the Job Backup Plugin: https://wiki.jenkins-ci.org/display/JENKINS/thinBackup With this you can export and import Job configurations...

like image 31
Strinder Avatar answered Nov 04 '22 20:11

Strinder