Jenkins Intro

Jenkins Intro

#90DaysofDevops #Day22 Task #TrainWithShubam

ยท

3 min read

What is Jenkins?

Jenkins is a DevOps Automation tool that is used to build jobs with CI/CD pipelines and can automate the app deployment from end to end with help of a plugins. Jenkins is developed using Java.

What is CI/CD/CD?

CI means Continuous Integration Continous Integration is used to automate pulling the code from source code management, building and testing. CD means Continuous Delivery is used to automate the deployment of build code with help of manual Intervention. Finally, the CD is Continuous Deployment which will automate the deployment as well without manual intervention.

Why we should use Jenkins?

  • Open Source with great community support.

  • A lot of plugins

  • Easy to Install

  • Free of cost

  • It is built with Java and hence, it is portable to all the major platforms.

Jenkins Installation

  1. Create an AWS EC2 Instance AMI of your choice I am picking up Ubuntu.

  2. Now Head over to Jenkins's official documentation.

  3. Run Following Commands in your EC2 Instance based upon AMI I am posting Ubuntu Commands Below.

     curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo tee \
       /usr/share/keyrings/jenkins-keyring.asc > /dev/null
     echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
       https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
       /etc/apt/sources.list.d/jenkins.list > /dev/null
     sudo apt-get update
      sudo apt install openjdk-11-jre
     sudo apt-get install jenkins\
    
  4. Now open your EC2 Instance and add port number 8080 to your Inbound Rules in Security Group.

  5. Now Copy your Instance Public Ip and Add 8080 to it to go to the Jenkins page.

    publicip:8080

  6. You will see a start-up page of Jenkins.

  7. Now go to your instance and run the following command to get the password.

     cat /var/lib/jenkins/secrets/intialAdminPassword
    
  8. Next select install suggested plugins

  9. Now copy the password to Jenkins and setup your user Id and Password

  10. Tada your Jenkins is Successfully Installed ๐Ÿ‘๐Ÿ‘๐ŸŽ‰๐ŸŽ‰.

Creating our first job to print Hello World in Console.

  1. Click on Create a job or New Item.

  2. Enter Job Name Select Freestyle project and select ok

  3. Now In the Description Enter anything of your choice related to the job.

  4. Now go to Build Steps and select execute the shell(It is used to run Linux or shell commands).

  5. Now enter the command then click on apply and save.

  6. Now Click on Build Now then in build history #1 will be created select on it to open console output.

  7. Let's See the Console Output.

  8. Tada We have Successfully created a job in Jenkins to run Hello World and We can see the output in Console. Congratulations on your first job in Jenkins ๐ŸŽ‰๐ŸŽ‰.

Thanks for Watching out for my blog will come up with more Jenkins blogs and projects on Jenkins shortly.

ย