Getting Started Jenkins Continuous Integration On FreeBSD

Continuous Integration is the most important part of DevOps used to integrate various stages of DevOps. Jenkins is the most famous Continuous Integration tool. Jenkins is an open source application automation tool written in Java with plugins created for continuous integration. Jenkins is used to build and test software projects continuously, making it easier for developers to integrate changes to the project, and making it easier for users to get the latest version of the application they are using. It also allows its users to continuously deliver software by continuously integrating a large number of testing and deployment technologies.

With Jenkins, organizations can speed up the software development process through automation. Jenkins integrates all types of development lifecycle processes, including build, document, test, package, stage, deploy, static analysis, and more.

Jenkins can achieve its goal as a continuous integration tool with the help of plugins. Plugins allow integration of different stages of DevOps. If we want to integrate a particular tool, we are required to install a plugin for that tool. For example Git, Maven 2 projects, Amazon EC2, HTML publisher and others.

Jenkins is an open source continuous integration (CI) server written in Java. It is a web application that allows you to automate various software development tasks such as building, testing, and deployment. Jenkins can be used for a variety of projects, regardless of size or complexity.

Jenkins is a powerful tool that can help automate the software development process and improve its quality. If you are looking for a way to improve your software development process, Jenkins is a great choice.

1. Benefits of Jenkins

The Jenkins platform has many advantages that make it very popular for automating software development processes. Here are some of the most obvious advantages of this platform:
  1. Free and Opensource: It is an open source platform that is free, meaning it is free to use and contribute to its development.
  2. Powerful: Has many features that allow you to automate various software development tasks.
  3. Expandable: Has many plugins that you can use to add new features and integrate with other tools.
  4. Community: Has a large and active community of users and developers who can provide support and assistance.
  5. Very easy to install.

2. What is continuous integration?

Continuous Integration (CI) is a development practice that requires developers to commit source code changes to a shared repository several times a day or more frequently. Any commits made to the repository are then created. This allows the team to detect problems early. Additionally, depending on the Continuous Integration tool, there are several other features such as deploying build applications to test servers, sharing build and test results with stakeholder groups, etc.

In software engineering, Continuous Integration is often interpreted as a form of quality control, where small efforts are frequently applied, as opposed to the more traditional method of applying quality control after development has been completed. Integration is verified by automated builds which are used to detect integration errors as quickly as possible and test the software.

Development teams use a continuous integration approach to software development because it allows them to develop in a faster and more efficient manner than if they worked separately for longer periods of time.

3. Continuous Integration with Jenkins

Imagine a scenario where the complete source code for an application has been created and then deployed to a test server for testing. This seems like an ideal way to develop software, but the process has many drawbacks. I will try to explain them one by one.
  1. Developers must wait until full test results of the software are developed.
  2. There is a high probability that the test results will show some errors. The developers had difficulty finding the bug because they had to check the entire application source code.
  3. Slows down the software delivery process.
  4. There has been no ongoing feedback regarding issues such as coding or architectural issues, build failures, test status, and release file uploads, which can reduce software quality.
  5. The entire process is carried out manually, thereby increasing the risk of frequent failures.
It can be seen from the problems above that not only is the software delivery process slow, but the quality of the software is also decreasing. This causes customer dissatisfaction. Therefore, to deal with the chaos, there is a strong need for a system in place where developers can continuously run builds and tests for every change made to the source code. That's what CI is all about. Jenkins is the most mature CI tool available, so let's see how continuous integration with Jenkins has overcome the above shortcomings.

First, I will explain to you the general scheme of continuous integration with Jenkins so that it becomes clear how Jenkins overcomes the above disadvantages:
  1. First, the developer commits the code to a source code repository. Meanwhile, the Jenkins server regularly checks for changes to the repository.
  2. As soon as a commit occurs, the Jenkins server detects the changes that occurred in the source code repository. Jenkins will commit these changes and start preparing the new version.
  3. If the build fails, the appropriate teams will be notified.
  4. If the build is successful, Jenkins deploys the built-in test server.
  5. After testing, Jenkins generates feedback and then notifies developers of the build and test results.
  6. It will continuously check the source code repository for changes made to the source code, and the entire process will repeat itself.

4. Installing Jenkins on FreeBSD

Because Jenkins is built in Java, it would be a good idea for you to read the article about Java that we wrote previously.

To install Jenkins, we have to install Java first. Let's assume you have read the Java article above and the Java system has been installed on the FreeBSD computer. So now we just continue with the Jenkins installation process on the FreeBSD computer. In this article we install Jenkins on OS FreeBSD 13.2. The following is how to install Jenkins.

root@ns1:~ # cd /usr/ports/devel/jenkins
root@ns1:/usr/ports/devel/jenkins #
make install clean

When the installation process is complete, continue by editing the /etc/rc.conf file, to start up rc.d. Enter the following command in the /etc/rc.conf file.

root@ns1:~ # ee /etc/rc.conf
jenkins_args="--webroot=${jenkins_home}/war --httpListenAddress= --httpPort=8180"

Then we continue to the next step, namely restarting Jenkins to activate Jenkins on the FreeBSD system.

root@ns1:~ # service jenkins restart
Stopping jenkins.
Waiting for PIDS: 913.
Starting jenkins.

At this point, the Jenkins configuration via the Command Line interface menu has been completed, now we will continue configuring Jenkin via the GUI menu. It's easier because there are pictures like we use Windows. To configure Jenkins with a GUI, we open the Google Chrome or Yandex web browser. In the new address menu, type the IP address and port that we specified above, after pressing the "enter" button an image will appear as below.

The Jenkins password can be seen in the file /usr/local/jenkins/secrets/initialAdminPassword, open the file and copy and paste the password to open Jenkins.

root@ns1:~ # ee /usr/local/jenkins/secrets/initialAdminPassword

79fa6b92b88b4ec593fd2ae77ffc501f is the Jenkins password. With this password we can enter the Jenkin GUI menu and can change the password. After the Jenkins menu opens, the first time Jenkins will synchronize, wait a few moments until the synchronization process is complete.

As mentioned at the beginning of this post, the discussion in this article is just a brief introduction to Continuous Integration with Jenkins on FreeBSD. You are advised to check the online documentation about Jenkins and Continuous Integration on the official Jenkins website. Jenkins also provides many ready-to-use plugins that extend its functionality. You can check out the available plugins for Jenkins here and install them as required.
Iwan Setiawan

I Like Adventure: Mahameru Mount, Rinjani Mount I Like Writer FreeBSD

Post a Comment

Previous Post Next Post