How can I export an existing job into an Jenkinsfile? How can I export an existing job into an Jenkinsfile? jenkins jenkins

How can I export an existing job into an Jenkinsfile?


Turns out the short answer is that you can't.

You need to look up each plugin you use and see if it has a syntax or support for Jenkinsfile and Pipelines.


You might give the Convert to Pipeline Plugin a try. It's primary purpose is to attempt to convert existing non-Pipeline Jenkins jobs into Pipeline jobs, complete with an option to generate a Jenkinsfile which is in turn committed to source control. As you correctly noted, there may still be several obstacles to a successful conversion (including support for Pipeline in various plugins).


http://thingsyoudidntknowaboutjenkins.tumblr.com/post/23596855946/git-plugin-part-3

Basically need to execute:

git checkout masterbefore modifying any files

then

git commit -am "Updated version number"after modified files

and then use post build action of Git Publisher with an option of Merge Results which will push changes to github on successful build.