In this Guide we are going to learn how to install and configure Jenkins in Fedora 35.
Jenkins is a popular open source 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 on Ubuntu 20.04
- How to install and set up Jenkins in Rocky Linux/Centos 8
Requirements
- A Linux system with Fedora 35 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. In Fedora, to check what software provides the java command line, use the following command: dnf whatprovides java
|
|
We can see that it is provided by the java-1.8.0-openjdk-1:1.8.0.275.b01-1.el8_3.x86_64
. Install it using the command
|
|
Install Jenkins
Add jenkins repository
Jenkins isn’t included in the default CentOS software repositories. Use the following commands to add and import the GPG key to ensure your software is legitimate.
|
|
You can check the presence of the repo using this command:
|
|
Install jenkins
Use the following command to install the latest stable build of jenkins:
|
|
Starting and enabling jenkins
Now that jenkins is installed, we ca start it:
|
|
To display the status of the Jenkins service, enter the following:
|
|
Please check to ensure that the status is active (running)
to know that the installation was successful.
Enable Jenkins in firewalld
You also need to add Jenkins service to run with firewall and add its exception so that it is available to access from the outside world. Finally, we need to reload the firewall service for the changes to take effect.
|
|
To check the firewall status and accessible ports, use the firewall-cmd
command:
|
|
Now, the Jenkins server will be running on port 8080 for our server.
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 /var/lib/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 Jenkins in a Fedora server in this guide.