Freestyle and Pipeline Jenkins Jobs
Jenkins – one of the commonly used continuous integration (CI) tool offers different ways to orchestrate jobs. It is kind of a scheduler that executes commands as per the defined steps.
While working in Jenkins, you will come across different types of Jenkins projects – Freestyle and Pipeline. Freestyle project is the default feature in Jenkins while creating a new project. The other new feature that was added sometime ago was the Pipeline projects. Let us take a look at the differences between these two.
Freestyle projects for simple tasks–
This is a general purpose project that is meant to build or run simple jobs like allowing you to specify the version control system from which you need to extract code and build it and call tests if available. This type of projects is meant to orchestrate simple jobs for a project.
Pipeline projects for larger projects-
This is a new type of Jenkins project that is applicable when you need to setup continuous delivery pipeline or say you want to define the deployment pipeline as code. Let us take an example wherein you need to orchestrate all the stages in delivering an application as one single pipeline project-
App build -> Unit testing -> Deliver -> Testing -> Deploy
Each stage is a job that executes the command and calls in the other stage and it can even pass arguments. These pipelines can be built either through a web interface or through a scripted file (JenkinsFile) which can be checked in a source control file. The advantage of scripting a pipeline is that you can create pipelines automatically for all branches and execute requests all through a single file – JenkinsFile. And such a file can be reviewed, audited and edited by multiple users. An excellent example of pipeline projects are Infrastructure as a Code (IaaC).
Look forward for the next article on implementing a pipeline project.
Did you find this article useful?
Very nice article.