JenkinsFile & Pipeline Setup : Step by Step Procedure

Step 1: The settings for the plugin can be found under,

  • Manage Jenkins > Manage Plugins.
  • If you have already installed the plugin, it is shown under the installed tab.

Step 2: If you do not have the plugin previously installed,

  • it shows up under the Available tab.
  • Once you have successfully installed the build pipeline plugin in your Jenkins, follow these steps to create your Jenkins pipeline:

Step 3:

  • Click on the “+” button on the left-hand side of your Jenkins dashboard to create a pipeline.

Step 4:

  • You will be asked to give a name to the pipeline view. We shall call it “Guru99 Pipeline” for the duration of this demo.
  • Select Build a pipeline view under options
  • Click ok

Step 5:

  • In the next page, you will be asked for some more details to configure your Jenkins pipeline. Just accept the default settings, and make sure you choose the first job under the settings.
  • Click on Apply and then OK
  • This will show you the sample pipeline view of your item, as given below:

Step 6:

  • For running a pipeline build, you need to chain your jobs first. For this, go to your first job and click on configure.

Step 7:

  • Now, under Build Triggers, check the Build after other projects are built option.
  • Thus, a chain for all your jobs has been created.

Step 8:

  • Install the Build Pipeline view plugin if you don’t have it installed already.
  • Go to your Jenkins dashboard and create a view by clicking on the “+” button. Select the Build Pipeline View option and click OK.

Step 9:

  • Under Pipeline view configuration, locate Pipeline Flow.
  • Under Pipeline flow, select the initial job to run. Now choose the job which has chains to other jobs, as shown in Step 1 and Step 2.
  • Here we have selected Guru99 Project 1 as the initial job, chained to other jobs. So, one by one, the jobs will run in the pipeline.
  • When the Jenkins pipeline is running, you can check its status with the help of Red and Green status symbols. Red means the pipeline has failed, while green indicates success.
  • In this Jenkins pipeline example, we see that the button is green. Hence, the pipeline is successful.
  • Click on Run to run the Jenkins pipeline. It will look something like this:
  • In the Jenkins pipeline script example above, we are demonstrating a simple “helloworld.java” program. But in real time projects, you will be responsible for creating and building complex pipelines in Jenkins. See below for a sample pipeline view.

Leave a Comment

MFH IT Solutions (Regd No -LIN : AP-03-46-003-03147775)

Consultation & project support organization.

Contact

MFH IT Solutions (Regd)
NAD Kotha Road, Opp Bashyam School, Butchurajupalem, Jaya Prakash Nagar Visakhapatnam, Andhra Pradesh – 530027