Jenkins is an extensible, web-based software system for the continuous integration of software components into an application program. It is considered a fork of the Hudson software by Sun, now Oracle. With Jenkins, we can efficiently manage tasks from building to deploying software. We need Oracle JDK 11 installed for Jenkins. Navigate to this webpage:
1 | https://launchpad.net/~linuxuprising/+archive/ubuntu/java/+packages |
Find the package oracle-java11-installer-local (11.0.13-1~linuxuprising0) for focal. The version of the script is 11.0.7. In this case, you would need Oracle JDK 11.0.7. Navigate to:
1 | https://www.oracle.com/java/technologies/downloads/ |
Locate the jdk-11.0.13_linux-x64_bin.tar.gz
package (Java SE 11 > JDK Download), download to your computer and upload to your server. Now run these commands:
---
1 2 3 4 5 6 7 | sudo apt install software-properties-common sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EA8CACC073C3DB2A sudo add-apt-repository ppa:linuxuprising/java sudo apt update sudo mkdir -p /var/cache/oracle-jdk11-installer-local/ sudo cp jdk-11.0.7_linux-x64_bin.tar.gz /var/cache/oracle-jdk11-installer-local/ sudo apt install oracle-java11-installer-local |
You can manage by running:
1 2 3 4 5 6 7 8 9 | sudo update-alternatives --config java sudo update-alternatives --config javac sudo update-alternatives --config java # sudo nano /etc/environment ## add JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64" ## source /etc/environment echo $JAVA_HOME |
Back to installing Jenkins! Run these commands :
1 2 3 4 5 6 7 | wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add - sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list' sudo apt update sudo apt upgrade sudo apt install jenkins sudo systemctl start jenkins # sudo systemctl status jenkins |
You’ll get the below output against sudo systemctl status jenkins
:
1 2 3 4 5 6 | ● jenkins.service - LSB: Start Jenkins at boot time Loaded: loaded (/etc/init.d/jenkins; generated) Active: active (exited) since Fri 2020-06-05 21:21:46 UTC; 45s ago Docs: man:systemd-sysv-generator(8) Tasks: 0 (limit: 1137) CGroup: /system.slice/jenkins.service |
Remember that you may need to open your firewall’s port 8080. You’ll need this password for the next step:
1 | sudo cat /var/lib/jenkins/secrets/initialAdminPassword |
Visit the frontend of Jenkins on browser:
1 | http://server's-ip_or_domain:8080 |
You should receive the Unlock Jenkins screen. Paste the password we got in the above step. In the next screen, click the “Install suggested plugins” option, which will immediately begin the installation process. When the installation will get completed, you will be prompted to set up an administrative user.