Day-22 : Getting Started with Jenkins What is Jenkins ?
Table of contents
Jenkins is a free open-source Continuous Integration tool and automation server to monitor continuous integration and delivery. It is written in Java. It is known as an automated Continuous Delivery tool that helps to build and test the software system with easy integration of changes to the system.
Jenkins follows Groovy Scripting. Also, it enables developers to continuously check in their code and also analyze the post-build actions. The automation testers can use to run their tests as soon as the new code is added or code is modified.
We can easily find the bugs and issues and rectify them ASAP.
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.
Create a freestyle pipeline to print "Hello World!!"
Jenkins runs on Java so to install Jenkins, we need to install JDE(Java Development Kit) on our EC2 machine and then we can install Jenkins on the system.
To install JDK on the system -
sudo apt install openjdk-17-jre -y
To confirm the installation
java -version
Now we will install Jenkins
sudo apt update
curl -fsSL pkg.jenkins.io/debian-stable/jenkins.io-202.. | sudo tee
/usr/share/keyrings/jenkins-keyring.asc > /dev/null echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc]pkg.jenkins.io/debian-stable binary/ | sudo tee
/etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins
Now we need to check and enable and start the jenkins service
sudo systemctl enable jenkins
sudo systemctl start jenkins
sudo systemctl status jenkins
Also jenkins use 8080 port so we need to allow it from security group from our EC2 machine.
Now to access Jenkins - http://<your-ec2-instance-ip>:8080
We need to unlock jenkins now as it will ask you password which can be found by
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
Install Suggested Plugins: During the setup wizard, you'll be asked to install suggested plugins or choose plugins manually. It's generally a good idea to select the suggested plugins to get started.
Create Admin User: After plugin installation, you'll be asked to create an admin user account. Fill in the required details for your Jenkins admin user.
Jenkins Ready to Use: After completing the setup wizard, Jenkins is ready for use. Click on "Start using Jenkins" to access the Jenkins dashboard.
Congratulations! Jenkins is now installed and running on your Ubuntu EC2 instance. You can start creating Jenkins jobs and automating your software development process.
Build my first job from jenkins as below
History of my terminal commands:
Thanks for reading the blog & do share them with someone in need :)
Please share your views and suggestions, they are always welcome.
See you then in the next blog.