How can I export an existing job to a Jenkins file?

I would like to use Pipeline to track my Jenkin Jobs in my SCM. (Version control manager).

Can I use my existing jobs and export them to a valid Jenkinsfile that can be read by Pipeline?

The main plugins that I use that I will need to export are Github Pull Request Builder, test result reporters, code coverage reporters, and weak post-build tasks.

My main question is how to export Jenkins settings to a Jenkins file, as indicated in the link above, so I don't need to write everything manually.

+5
source share
2 answers

Turns out the short answer is that you cannot.

You need to find each plug-in and see if it has syntax or support for Jenkinsfile and Pipelines.

+5
source

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

In principle, you must do:

git check wizard before modifying any files

then

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

and then use the post build action from Git Publisher with the ability to merge the results, which will make changes to github if the build is successful.

-2
source

Source: https://habr.com/ru/post/1261504/


All Articles