In this Guide we are going to learn how to install and configure Jenkins in a FreeBSD 13 Server.
Jenkins is a popular opensource automation tool to perform continuous integration and build automation. Jenkins allows to execute a predefined list of steps, e.g. to compile golang source code to build build binary file. The trigger for this execution can be time or event based.
Possible steps executed by Jenkins are for example:
- Cloning the code from source control system.
- execute a command to install dependencies required for the code to run
- Run tests for the software
- build the software to get an executable
- Publish test results
- publish the resulting binary code
Jenkins monitors the execution of the steps and allows to stop the process, if one of the steps fails. Jenkins can also send out notifications in case of a build success or failure.
Jenkins can be extended by additional plug-ins. For example, you can install plug-ins to support building and testing Android applications.
Related Content:
- How to install and set up Jenkins in Fedora 35
- How to install and set up Jenkins in Rocky Linux/Centos 8
- How to Install and set up Jenkins on Ubuntu 20.04
Requirements
- A Linux system with Rocky Linux/CentOS 8 server (At least 2GB of Ram)
- A user account with sudo or root privileges
- Access to a terminal window/command line
- Recent Java version installed
Ensuring that the system is up to date
Ensure that the system packages are up to date using this command:
|
|
Install Java
In this section, we will install java on our system. We will be using the openjdk version of Java.
To confirm whether Java is installed locally, check the java -version
command.
|
|
From the above output it shows that the Java is not installed. Jenkins runs on Java version 11. To search the package providing openjdk 11 use this command:
|
|
From the above output we can see tha the package openjdk11 provides out required version of Java. Install it using this command:
|
|
Now we can finally confirm Java version
|
|
This OpenJDK implementation requires a few file systems to be mounted for full functionality. Run these commands to perform the required mounts immediately:
|
|
To make this change permanent, we must add these mount points to the /etc/fstab
file. Open the file to edit now:
|
|
Insert the following mount information into the file:
|
|
Save and exit.
Lastly, you will want to rehash to be sure that you can use your new Java binaries immediately:
|
|
The OpenJDK package that you selected is now installed and ready to be used!
Install Jenkins
Search what provides jenkin
|
|
Use the following command to install the lts version of jenkins
|
|
Starting and enabling jenkins
|
|
To display the status of the Jenkins service, enter the following:
|
|
Run this command to run jenkins on boot
|
|
Accessing the jenkins server
Once installed, open browser and navigate to the jenkins on the url http://127.0.0.1:8080/
. If you are running on a remote server, replace the ip 127.0.0.1
with that server’s ip.
You will be asked to provide an initial password found in this location /usr/local/jenkins/secrets/initialAdminPassword
. Get it by running this command on the server.
|
|
From here choose whether you want to install the recommended plugins or choose what you want to install.
The last page will allow you to set up some initial configuation for the user who will be using the jenkins server.
Conclusion
We managed to install and access Jenkins in our FreeBSD 13 server.