Jenkins: Freestyle vs pipeline jobs

Let’s look at some of the differences between Jenkins freestyle and pipeline jobs.

Freestyle Jobs

You configure a freestyle job in Jenkins using the GUI by adding steps to the build. Freestyle jobs give you a lot of flexibility. But, you will struggle to configure complex continuous delivery scenarios.

Pipeline Jobs

Pipeline jobs allow you to create a set of instructions using code. You can also easily visualize different stages in one place. Most importantly, you can keep all the code stored in a code repository. This will, in turn, allow you to version, audit, and keep track of changes.

Pipeline jobs are created using a Jenkinsfile. And Jenkinsfiles uses Apache Groovy as the scripting language.

A Jenkinsfile can use either of the following two syntaxes:

  • Declarative Pipelines – The declarative pipeline requires the Blue Ocean plugin. This plugin provides a graphical pipeline editor.
  • Scripted Pipelines – The scripted pipeline allows you to use the Jenkinsfile. But here you can use standard Jenkins.

Also, a Jenkins pipeline consists of many components.

These are:

  • Steps are single tasks that tell Jenkins what to do.
  • Stages groupings of steps like build, test and deploy.

For example, we can have a stage called “test”. And the “test” can, in turn, run many steps to test our code, the deployments, and more.

Wrapping up Jenkins freestyle vs pipeline jobs

As you can see, you set up freestyle jobs in Jenkins with the GUI. But, you use pipeline jobs to code more complex jobs using Jenkisfiles.

You may also be interested in

About Anto Online

Anto, a seasoned technologist with over two decades of experience, has traversed the tech landscape from Desktop Support Engineer to enterprise application consultant, specializing in AWS serverless technologies. He guides clients in leveraging serverless solutions while passionately exploring cutting-edge cloud concepts beyond his daily work. Anto's dedication to continuous learning, experimentation, and collaboration makes him a true inspiration, igniting others' interest in the transformative power of cloud computing.

View all posts by Anto Online

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.