What is Jenkins
Jenkins is an open-source automation server widely used for continuous integration and continuous delivery (CI/CD) in software development. Developed in Java, Jenkins automates the building, testing, and deployment of code, facilitating collaboration among development and operations teams. Its extensibility through plugins enables integration with various tools and technologies, making it a versatile automation solution.
Jenkins simplifies the software development lifecycle by automating repetitive tasks, enhancing code quality, and accelerating the delivery of applications. It supports the creation of pipelines, where developers can define a series of steps for building, testing, and deploying applications in a structured and repeatable manner. Jenkins provides a web-based interface for easy configuration and monitoring of jobs, and its distributed architecture allows for scalability. With a large and active community, Jenkins remains a pivotal tool for achieving efficient and automated software development practices.
Install Java with Apt on Ubuntu
sudo apt update && apt upgrade -y
#install the JRE:
sudo apt install default-jre -y
#Verify the installation:
java -version
#install JDK:
sudo apt install default-jdk
#Verify the installation:
javac -version
#Setting the JAVA_HOME Environment Variable:
sudo update-alternatives --config java
#sudo nano /etc/environment (At the end of this file, add the following line, making sure to replace the highlighted path with your own copied path, and to not include the bin/ portion of the path):
JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
source /etc/environment
echo $JAVA_HOME
Install Jenkins
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key |sudo gpg --dearmor -o /usr/share/keyrings/jenkins.gpg
sudo sh -c 'echo deb [signed-by=/usr/share/keyrings/jenkins.gpg] http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
sudo apt update
sudo apt install jenkins
#Starting Jenkins:
sudo systemctl start jenkins.service
sudo systemctl status jenkins
#Opening the Firewall:
sudo ufw allow 8080