Jared
Jared

Reputation: 880

difference between freestyle project and pipeline in jenkins

I'm a little confused about Freestyle project and pipeline in jenkins when trying to create new items.

When should I create item with Freestyle project? And in which case should I use pipeline?

Do I need to store config.xml into code repository for future import? Or any other usage?

Upvotes: 58

Views: 49306

Answers (8)

oshan2csd
oshan2csd

Reputation: 423

The main difference I see between Jenkins Freestyle projects and Pipeline is the usage of GUI vs scripting.

Below are some differences in more detail

Freestyle Projects

  • Use GUI to add different stages and steps
  • More suitable for less complex scenarios
  • Good for people who are starting to use Jenkins/ CI solutions
  • Can become hard to achieve what you want when your scenario become more complex

Pipeline Jobs

  • Use code (Groovy language - this is a Java like language) for giving instructions
  • Since, everything in one script you can keep that in the source control and have ability to revert back to an earlier version at any time or keep track of changes made to the script
  • Entire, pipeline consists of steps (ex: build, test, deploy etc..)
  • Created using a Jenkinsfile

Jenkinsfile can be one of two of below types

  1. Declarative Pipeline (Requires blue ocean plugin to use graphical pipeline editor)
  2. Scripted Pipeline

Usage of config.xml

You can append config.xml to the end of the jenkins url(in browser) and view all information related to that job as a xml file. This is also possible for user who do not have write access to that job. Not sure why do you need to store it in the source code.

Freestyle or Pipeline?

In my opinion, go for the pipeline if you have some experience with Jenkins. But if you're using it for the first time or do not have much experience, starting from Freestyle projects is a good idea and eventually you can convert it into a pipeline and achieve much more complex stuff.

Upvotes: 6

Mahesh
Mahesh

Reputation: 1

In pipeline we write a Jenkins file ,it is written in the language of groovy based.in this file we write all stages in single file it is automate the cl/cd . In free style job,it is use full in the learning process of ci/cd.in this we write the stages separately Group of stages are linked to called as pipeline.

Upvotes: 0

Jacques R
Jacques R

Reputation: 387

Another aspect you can take into consideration is the fact that you write code in a file. Therefore you can store it in a git server to keep your old jobs accessible

Upvotes: 1

Sangha
Sangha

Reputation: 61

If you’re a developer, writing your pipeline-as-code will feel more comfortable and natural. If you’re a DevOps professional, maintaining your pipeline will be easier because you can treat it like any other set of code that drives key processes.

Upvotes: 3

Naanii
Naanii

Reputation: 197

We can say the main difference between freestyle project and Pipeline. with Pipeline, you can write jenkins file using ruby program with this you can configure CI/CD.

Upvotes: -1

burnettk
burnettk

Reputation: 14047

if you've used jenkins in the past without using a Jenkinsfile, you've used something more similar to a freestyle project.

if you hate typing things into CI systems and therefore want to use pipelines as code--where you put all of your CI configuration into a file in source control (Jenkinsfile) and let Jenkins read that file to figure out what to do--use pipelines. once you know pipelines, there won't be many cases where you'll prefer freestyle projects.

Upvotes: 46

user2290254
user2290254

Reputation: 21

Try to add retrofit plugin if you want to implement UCD tool for CI CD pipeline

Upvotes: 1

Jefferson Bien-Aime
Jefferson Bien-Aime

Reputation: 179

The difference is that in Pipeline we have the ability to break our jobs out into different stages and we can have whatever stages we'd like to represent the process we use to deploy software and of course, if anything goes wrong, we can see which stage had the problem; for example. We even have the ability to add in verification before we proceed. We have the ability to run stages in parallel so we could have multiple tests executing in separate branches very easily.

Upvotes: 14

Related Questions