Jenkins Basics

Jenkins Basics

·

2 min read

Jenkins is an open-source project written in Java that runs on different platforms ( Windows, Linux, Mac OS, etc.). It was originally developed by Sun Microsystem in 2004 under the name Hudson but later named Jenkins when Oracle bought Microsystems.

Jenkins is a CICD ( Continuous Integration Continuous Deployment) tool that automates the entire software development lifecycle including build, document, test, package, stage, deploy, static analysis, and much more.

Workflow of Jenkins

Let us consider the basic example to understand how Jenkins works.

When the developers push the code in Github, Jenkins pulls the code to the build stage using the build tools such as (maven, ant, gradle, etc). Once the build step is completed the code is sent to the test stage for testing using( Selenium, Cucumber, etc) tools. The final step is to deploy the code in the environment.

Advantages of Jenkins

  1. It is an open-source tool.

  2. Jenkins has a free huge community and plugin support available.

  3. It behaves as a Cron Server replacement i.e. can do the scheduled task.

  4. Jenkins can have multiple agents attached to its master node. So we can schedule n no. of jobs on the slave nodes.

Simple Project - Create a freestyle job in Jenkins to print "Hello World!"

  1. Click on +New Item to create a new freestyle job.

  2. Enter the new item name and click on Freestyle project.

  3. Enter the Description, go to the build steps, and click on Execute Shell. Write the code in the shell to print the hello world.

  1. To run the build, click on Build Now. Your first job is created successfully!