Getting Started with Jenkins 😊

Getting Started with Jenkins 😊

Day 22

What is Jenkins?

  • Jenkins is an open source continuous integration-continuous delivery and deployment (CI/CD) automation software DevOps tool written in the Java programming language. It is used to implement CI/CD workflows, called pipelines.

  • Jenkins is a tool that is used for automation, and it is an open-source server that allows all the developers to build, test and deploy software. It works or runs on java as it is written in java. By using Jenkins we can make a continuous integration of projects(jobs) or end-to-endpoint automation.

  • Jenkins achieves Continuous Integration with the help of plugins. Plugins allow the integration of Various DevOps stages. If you want to integrate a particular tool, you need to install the plugins for that tool. For example Git, Maven 2 project, Amazon EC2, HTML publisher etc.

Let us do discuss the necessity of this tool before going ahead to the procedural part for installation:

  • Nowadays, humans are becoming lazy😴 day by day so even having digital screens and just one click button in front of us then also need some automation.

  • Here, I’m referring to that part of automation where we need not have to look upon a process(here called a job) for completion and after it doing another job. For that, we have Jenkins with us.

    What you understood in Jenkin, write a small article in your own words?

    Jenkins is defined as an open-source solution comprising an automation server to enable continuous integration and continuous delivery (CI/CD), automating the various stages of software development such as test, build, and deployment.

    Jenkins is a tool that is used for automation, and it is an open-source server that allows all the developers to build, test and deploy software. It works or runs on java as it is written in java. By using Jenkins we can make a continuous integration of projects(jobs) or end-to-endpoint automation.

    Let us do discuss the necessity of this tool before going ahead to the procedural part for installation. Nowadays, humans are becoming lazy day by day so even having digital screens and just one click button in front of us then also need some automation. Here, I’m referring to that part of automation where we need not have to look upon a process(here called a job) for completion and after it doing another job. For that, we have Jenkins with us.how can a

    What Is Jenkins?

    Jenkins is an open-source automation server that facilitates the automation of several stages of the software development lifecycle, including application development, testing, and deployment. Operating within servlet containers like Apache Tomcat, the technology is server-based.Continuous delivery (CD) and integration (CI) pipelines can be created and managed with Jenkins. The development, testing, and deployment of software applications are automated using CI/CD pipelines. You will be able to release software more regularly and with fewer problems if you do this.

    1. jenkins is flexible.

    2. You can add the n no.of plugins you want to add to the jenkins.

    3. You can automate the proceses of CI/CD pipelines of all the projects.

What is Jenkins CI/CD Pipeline?

Jenkins CI/CD stands for Continuous Integration / Continuous Deployment first let us try to understand what is a pipeline. In computing, a pipeline is a set of stages or processes linked together to form a processing system. Each stage in the pipeline takes an input, processes it in accordance with a set of rules, and then sends the outputs to the stage that follows. Frequently, the pipeline’s overall output is its final step’s output. like the procedures outlined below

  1. Test code

  2. Build Application

  3. Push Repository

  4. Deploy to Server

All the steps mentioned above will perform in sequence one after the other if any step/stage get failed it will not move forward to another step/stage until the previous step got a success

What is Jenkins Continuous Integration (CI)?

Jenkins Continuous integration means whenever new code is committed to remote repositories like GitHub, GitLab, etc. Continuous Integration (CI) will continuously build, tested, and merged into a shared repository.

Benefits of Continuous Integration (CI)

  • We can maintain the reports of the projects

  • Deployments can be made within the given time

  • Bugs can be found quickly.

What is Jenkins Continuous Deployment/Delivery (CD)?

Continuous Deployment

Continuous Deployment means automating the further stages of the pipeline automatically or manually deploying the application/code to different environments like Dev, Test, and Production. Automating the build is the main component of Continuous Integration and Continuous Deployment.

Continuous Delivery

Each and every build that passed all automated tests and was able to be fully automated and delivered into production only required one click of human intervention is called Continuous Delivery.

What Is Jenkins Freestyle Project?

Jenkins freestyle project is an configuration and options based project which will allows you to build,test, and deploy the application with automation by selecting the required configuration based on the requirement following are the some of the available in the freestyle project.

  1. Building and testing code

  2. Packaging applications

  3. Deploying applications to production servers

  4. Running reports

What is Jenkins Pipeline?

DevOps professionals mostly work with pipelines because pipelines can automate the processes like building, testing, and deploying the application. Doing manually by UI takes lots of time and effort which will affect productivity. With the help of Continuous Integration / Continuous Deployment (CI/CD) Pipeline scripts we can automate the whole process which will increase productivity and save lots of time for the organization and can deliver quality applications to the end users.To know more about how to build the CI/CD pipeline please refer to the How to Make a CI-CD Pipeline in Jenkins?.

What is Jenkins Multi Configuration Projects?

You can run different builds of the same project with different configurations when you create a Jenkins Multi-Configuration Project (MCP).

Installation of Jenkins in windows:

  1. Before installing Jenkins you should have already installed java on your device as above said it works on java, so it’s important to install and for that, you should install version jdk8. You can find the download it from the link provided. Make sure while downloading JDK8, choose a favorable option based on your OS (like windows X 64 bit), and then install the JDK8.

    • After installing java check it by using command prompt by java -version and this will show whether you have it or not.
  2. Now, go to the official website of Jenkins i.e. www.jenkins.io. Here you will have two options one is an LTS release and one is a weekly release. Download Jenkins for windows from the LTS section(recommended).

  3. After download, open that zip(compressed) file, and by right click and choose the all extract option extract the file. We are doing extraction to unzip the compressed file.

  4. After extracting, you can see a new folder of Jenkins. Open it and install Jenkins. After installing, it will automatically take you to the browser where localhost::8080 is running. 8080 is the by default port of Jenkins. And if the browser automatically doesn’t open then simply search localhost::8080.

    • After this, you will see the dashboard or interface of Jenkins. If you are installing it the first time then it will show you some plugins which are recommended to install. And then, you are ready to use Jenkins.

We will be creating a very basic job that will throw some output. So, let us begin. Creating and running a job on Jenkins is as follows

Step 1: Click on a new item, and then you will have a page on which you have to give your name to your job and choose ‘freestyle project’ or any other option according to your need and then click ‘ok’.

Step 2: After this, you will reach a page where you have different options(like build, build triggers, source code management) that help you manage your job.

Step 3: Now, we will give some description of our job.

Step 4: Now, you have to provide which source code management tool you are using since here we are not using anyone so will choose the ‘none’ option.

Step 5: After this, if you want to give some triggers then you can choose accordingly even Jenkins provides us scheduled triggers. And you can choose to build an environment also accordingly. But, here we are making a simple job, so we are not using any triggers and build environment options.

Step 6: In the build section we have an option ‘Execute Windows batch command’ by which we can write some command or code.

Step 7: Now, you can give the command according to your need.

Then click apply and save. So, your job is created.

Step 8: Now, we will run it for which click the ‘build now’ option and a building history will be created then click on it.

Step 9: Now, Click on console output, and you can see your output. Also, by console output, you can see whether your job is failed or successful.

By now we are over with the procedural part and Jenkins is installed on the machine. Lets us finally do discuss out the meaning of some terms listed as follows:

    Console output- gives details on how/what it runs behind.
    Run any job== build now.
    The symbol of the sun means the success of your job.
    The symbol of the cloud means the failure of your job.
    The trigger means automatic run and also we can give a schedule in it.

Key Points to Remember:

  • Since we know in open source we use git and GitHub and to do automation we have to make interact Jenkins with GitHub so you need plugins to do so. And the plugin is nothing other than a software program that adds some important features to the existing one. Why plugins? Jenkins knows how to clone from GitHub and integrate, but plugins give it a mind to understand various commands of git.

  • Whenever a job is downloading a file/folder so that Jenkins has to provide a space and that space is known as workspace. Normally, we use Jenkins for job chaining.

  • Job chaining– Connecting the jobs with each other that is whenever the earlier job will run fine then Jenkins will go to the next job. This is also known as a pipeline. For example- Suppose you have made 3 jobs in Jenkins and you want them to run when the earlier one completes. So, when Job1 has been run already then Job2 will run and then Job3. So to do this, copy earlier job in copy tab and from triggers choose ‘build after other projects’ option. Here, Job2 is upstream with respect to Job3 and downstream with respect to Job1.

  • Install pipeline plugins to have a better view because by this we can visualize for upstream and downstream. By default, we can run only two jobs parallel in Jenkins. But we can also run more jobs parallel, and it depends on your RAM of OS.

FAQs On Jenkins

1. What Is Use of Jenkins?

Jenkins is a popular open-source automation server used mostly for software development’s continuous integration and delivery (CI/CD) processes.

2. Is Jenkins Software Tool

Yes, Jenkins is an software tool which is used for the implementation of continuous integration and continuous delivery (CI/CD) pipelines.

3. Jenkins Pipeline

DevOps professionals mostly work with pipelines because pipelines can automate the processes like building, testing, and deploying the application. Doing manually by UI takes lots of time and effort which will affect productivity. To know how to write CI/CD pipeline refere to the How to Make a CI-CD Pipeline in Jenkins?

Â