Day 22 - Embarking on the Jenkins Journey πŸš€πŸ˜ƒ

Day 22 - Embarking on the Jenkins Journey πŸš€πŸ˜ƒ

Β·

3 min read

πŸš€ What is Jenkins?

What is Jenkins?

Jenkins, the superhero of continuous integration-continuous delivery and deployment (CI/CD), is an open-source automation maestro written in Java. πŸ¦Έβ€β™‚οΈβœ¨ It orchestrates CI/CD workflows, known as pipelines.

Jenkins is your go-to tool for automation, an open-source server empowering developers to effortlessly build, test, and deploy software. πŸ› οΈπŸ’» It runs on Java, making continuous integration and end-to-end automation a breeze.

Jenkins achieves Continuous Integration with the help of plugins – think of them as magical tools integrating various DevOps stages. Need Git integration? Maven support? Just plug in the right one! 🧩🌐

Why Jenkins?

In a world where digital screens and one-click buttons are abundant, why the need for Jenkins? Because, let's admit it, we're becoming a bit lazy! 😴 But not the lazy where we avoid work – the kind where we'd rather automate repetitive tasks and let Jenkins handle the heavy lifting. πŸ€–πŸ’Ό

Jenkins steps in precisely where you don't want to babysit a process (here called a job) for completion before moving on to the next. It's our automation ally, ensuring efficiency without the constant watch. πŸ€πŸ”§

In a world where simplicity matters, Jenkins automates tasks with plugins, integrating various DevOps stages like Git, Maven, Amazon EC2, and more. βš™οΈ

πŸš€ Step-by-Step Guide: Installing Jenkins 🌐

Step 1: Update Package Lists

πŸ”„ Update your package lists to ensure you have the latest information about available packages:

sudo apt update

Step 2: Install Required Dependencies

πŸ› οΈ Install the necessary dependencies, including fontconfig and OpenJDK 17:

sudo apt install fontconfig openjdk-17-jre

Step 3: Add Jenkins Repository Key

πŸ”‘ Download and add the Jenkins repository key to your system's keyring:

sudo wget -O /usr/share/keyrings/jenkins-keyring.asc https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key

Step 4: Add Jenkins Repository to Sources List

βž• Add the Jenkins repository to the apt sources list:

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

Step 5: Update Package Lists Again

πŸ”„ Update the package lists with the new Jenkins repository:

sudo apt-get update

Step 6: Install Jenkins

πŸš€ Install Jenkins from the LTS (Long-Term Support) release:

sudo apt-get install jenkins

This will install Jenkins and its dependencies on your system.

Step 7: Start Jenkins Service

▢️ Start the Jenkins service:

sudo systemctl start jenkins

Step 8: Enable Jenkins to Start on Boot

πŸ”„ Enable Jenkins to start automatically on boot:

sudo systemctl enable jenkins

Step 9: Check Jenkins Status

πŸ” Check the status of the Jenkins service to make sure it's running without any issues:

sudo systemctl status jenkins

Step 10: Open Jenkins in your Browser

🌐 Jenkins, by default, runs on port 8080. Open your web browser and navigate to:

http://your_server_ip_or_domain:8080

Follow the on-screen instructions to complete the Jenkins setup.

That's it! You've successfully installed Jenkins on your Ubuntu system using the provided commands.

πŸš€ Jenkins Freestyle Pipeline: Printing 'Hello World!!' 🌐

1.Create a New Job:

  • Log in to Jenkins.

  • Click on "New Item."

  • Enter a name for the job and select "Freestyle project"

2.Configure the Job:

  • Under the "Build" section, click on "Add build step" and choose "Execute shell"

  • In the command box, type: echo "Hello World!!"

3.Save and Run:

  • Save the job configuration.

  • Click on "Build Now" to run the job.

Did you find this article valuable?

Support Nilkanth Mistry by becoming a sponsor. Any amount is appreciated!

Β