Let’s look at some of the differences between Jenkins freestyle and pipeline 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 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.
- 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 the Authors
Anto's editorial team loves the cloud as much as you! Each member of Anto's editorial team is a Cloud expert in their own right. Anto Online takes great pride in helping fellow Cloud enthusiasts. Let us know if you have an excellent idea for the next topic! Contact Anto Online if you want to contribute.
Support the Cause
Support Anto Online and buy us a coffee. Anything is possible with coffee and code.