Jenkins

2 min read

Cover Image for Jenkins

What is Jenkins?

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

  • Jenkins is a tool 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 continuously integrate 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.

How to set up Jenkins in Linux AWS EC2 instance

  1. Create an account on AWS and launch an EC2 Linux instance with free tier service.

  2. Connect with EC2 instance with SSH:

    select EC2 instance and click on connect.

    it shows various connecting services like session service, EC2 connect, SSH client, etc.

    • Install Java:

        #Update your system
        sudo apt update
        #Install java
        sudo apt install openjdk-11-jre
        #Validate Installation
        java -version
      

  • Install jenkins:

      #update 
      sudo apt update
      # add jenkins to repository key 
      wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add
      # add jenkins to repo
      sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
      #install jenkins
      sudo apt install jenkins
    
  • to check jenkins run cmd:

      sudo systemctl status jenkins
      #or 
      jenkins --version
    

  1. Enable Security group setting at port 8080

    • to access jenkins in web we have to enable security setting at port 8080

    • then use this command to view password

        sudo cat /var/lib/jenkins/secrets/initialAdminPassword
      

Congratulation🎉, you have setup Jenkins on AWS ubuntu EC2 instance.

Happy learning !!