CI/CD pipeline – A fuel for SDLC

Pipeline concept with Jenkins

Jenkins Pipeline is a set (package) of plugins that helps implement and integrate constant delivery pipelines. It provides a set of tools for modeling simple and complex delivery pipelines “as code” through the DSL Pipeline.

Prerequisites for Jenkins Pipeline

  • Jenkins version 2.xx
  • Pipeline plugin

Define a pipeline

The pipelines (declarative and scripted) are DSLs (Domain Specific Language). To write the pipeline process, Groovy DSL syntax is used. Using Groovy-based commands, we write the process flow of your pipeline process.

Read also – DevOps in-house or outsourced: pros and cons

Illustrative example of setting up a pipeline job in Jenkins

Step 1:

Add a new post to Jenkins

Login to Jenkins Dashboard > (Click) New Task > Enter Item Name > (Select) Pipeline Option.

After adding a new task, click the task title and display the task edit page.

2nd step –

Then go to the “Configure > Pipeline” tab.

On the Pipeline tab, you must specify the pipeline script to use to drive this task. To do this, you will have two options –

  • Use the pipeline script hosted in your GIT repository.
  • Add the pipeline script directly in the provided text box.

Illustrative example of setting up a pipeline job in Jenkins

This was one of ci/cd pipeline example, we add pipeline script in textbox. After adding, click the Save button. It will save the job.

Step 3 –
To test this work, click on the “Build Now” link. It will trigger the job execution and execute each step indicated in the pipeline script. When the task execution is complete, check the last executed version in the version history and click “Console Output”.

Illustrative example of setting up a pipeline job in Jenkins

In the console output, we can take note of each step’s execution alongside their output.

Jack L. Goldstein