9

I do have existing project which has a few steps and I would like to have exactly same thing with multibranch support. Multi branch project is looking good but I need to use Pipeline and create Jenkinsfile, but when it comes to Pipelines I do struggle to find good documentation and examples.

So an idea is that it would be really handy, if I can convert existing project into Pipeline because that would really help.

Is there a way how this can be done or do I have to write Jenkinsfile from scratch?

Zdenek Machek
  • 1,758
  • 1
  • 20
  • 30
  • 1
    Not used it but you could try https://wiki.jenkins.io/display/JENKINS/Convert+To+Pipeline+Plugin – Chris Yallop Feb 15 '18 at 10:38
  • 3
    Can someone explain why this question was closed? – whirlwin Feb 20 '20 at 11:56
  • agree, seems like a reasonable question to me. i wonder what guildine was violated. – Ray Tayek May 01 '21 at 20:22
  • 1
    Not my close vote, but questions asking for software recommendations are explicitly off-topic here. This could perhaps be refactored into a "how can I" question but then the OP should contain at least a modicum of research effort. – tripleee Jul 28 '21 at 08:05
  • I disagree, pipeline is something what you need to program also question popularity clearly shows people are interested so "purity of questions" vs reality of real world problems. – Zdenek Machek Jul 29 '21 at 09:11

3 Answers3

8

I don't know a tool that converts existing project to pipeline project, so I guess you'd have to start from scratch.

The documentation is not great but there are plenty of resource to follow:

Amityo
  • 5,635
  • 4
  • 22
  • 29
6

I haven't tried it, but I've seen that others have. Use this to translate your current project's config.xml: https://github.com/visualphoenix/jenkins-xml-to-jobdsl

Generic Ratzlaugh
  • 717
  • 1
  • 6
  • 13
  • 1
    See https://stackoverflow.com/questions/8424228/export-import-jobs-in-jenkins for how to obtain the XML. – tripleee Jul 28 '21 at 08:37
0

This may help. it says auto convert from free style to pipeline - https://jenkinsworld20162017.sched.com/event/Bk3r/auto-convert-your-freestyle-jenkins-jobs-to-coded-pipeline?iframe=no&w=100%&sidebar=yes&bg=no

sw_engineer
  • 1,022
  • 2
  • 11
  • 15