Jenkins is a Java-written open source server that can help you streamline your software development processes. It facilitates this through continuous integration (CI). Jenkins is the ultimate server in that it offers a straightforward way to configure CI and provides the complete foundation for working with any set of languages or source code repositories.
Jenkins’ competitive advantage is that its plugins number upwards of over 1,400. These plugins support the automation of various development tasks and were primarily developed to quench the need for CI and CD in Java Code Environments (JCE)—with the possible exception of the Chuck Norris plugin which uses various images and quotes from the man himself just to motivate your ass. The development tasks that all these plugins support include—but are not limited to—running tests, static code analysis, building projects, and deployment, among many, many other capabilities.
There are six reasons for using Jenkins;
- As an installer package for the major operating systems
- To make it easier to convert CLI to GUI
- To integrate individual projects for a larger purpose
- For project management with accurate data support
- To keep your team in sync
- To troubleshoot and audit past jobs effortlessly
When you access Jenkins for the first time, it will create an administrative user and a password which you will need to use in the first webpage to unlock installation. After installation, you can either use the default plugins or create your own list of plugins. After identifying your set of plugins, click install, and Jenkins will add them to your list.
The main screen for Jenkins shows the current built queue and executor status. It also provides links to create new jobs (projects), view build histories, manage users and credentials, and look at custom views.
The 1,400 plugins encompass source code management, administration, platforms, UI/UX, building management, and much more. With the vast number of plugins available, you can select to deploy any number of them to enhance productivity, but here are some of the top ones that we suggest using.
The ‘Dashboard view plugin’ provides a new Jenkins dashboard that allows you to monitor the status of all the tasks. Ideally, this also has time tracking capabilities for the duration taken by each job and also shows the entire time execution. These are fundamentals that help you manage Jenkins.
The ‘View Job Filters plugin’ is an out-of-the-box method to build different views for all your Jenkins jobs. Whether it’s build status or trends and triggers, with the ‘View Job Filters plugin,’ you will find all these filtering options in addition to many others.
The ‘Folders plugin’ is a great method for grouping your Jenkins tasks. This fact this plugin has been downloaded over 120,000 times speaks volumes about its usefulness. Furthermore, organize your CI server can be arranged perfectly with the nestable folders available in this plugin.
The ‘Monitoring Plugin’ uses JavaMelody to keep track of Jenkins. This plugin allocates charts for CPU, HTTP response time, memory, and much more. It further provides information on HTTP periods, logs accounts, head dumps, and other data. With this plugin, you can check the status/progress of jobs under consideration and view statistics that will help you proactively manage Jenkins via the interface.
The ‘Disk-Usage Plugin’ provides for the calculation of disk usage in periods of 60 minutes. You can see a list of projects with space occupied on the disk and at the same time, schedule the calculation of disk usage.
Use this plugin in both Jenkins pipelines and GUI jobs. The tool provides report capturing capabilities through a whole range of favorite testing tools like JMeter, JUnit or Taurus. You can watch your project’s performance via trend reports and graphs, and set your build status to either right, unstable or failed.
An outstanding feature of Performance Published plugin is that it is designed to work with every testing tool by generating trend and global reports for test result analysis. It computes stats, underlines regressions and modifications, and creates any number of trend graphs, but you need to generate the XML files with your own testing tool.
Scaling Jenkins Setup
Setting up Jenkins is straightforward for immediate CI functionality and to run automated tests on its own. But as you run more jobs on your Jenkins server, it will quickly become apparent that one instance is not enough even assuming they might run in parallel to each other. For these occurrences, Jenkins provides the “master/slaves” mode.
There are numerous ways to configure the Jenkins’ master and slaves. The best recommendation is to allocate new slaves’ instances only when they are necessary and to exclude them when it’s not convenient having them.
The next two plugins are great for handling Jenkins server scalability.
The ‘Kubernetes plugin’ works, surprisingly, with Kubernetes. So, if you plan to use Kubernetes for your infrastructure, this plugin is the way forward for setting up and tearing down Jenkins’ agents. While moving to Kubernetes is not the easiest process, the results are worth it.
The decision for using this plugin or the one above lies simply with, are you using Docker Swarm or Kubernetes? This plugin offers just another method to spin up and pull down Jenkins slaves.
Use the ‘Amazon ECS Container Service’ plugin to manage Jenkins cloud slaves and deploy Docker-based applications on a cluster.
Your new AKS (rebranding by Azure) cluster orchestration plugin to run a container as an agent through Jenkins.
Tests Analysis Plugins
Jenkins is the ultimate companion for performing your tests as part of CI. However, Jenkins doesn’t provide any way of studying test results after execution, which is an essential aspect of testing.
The Test Results plugin is preferable as it offers greater visibility on tests results and execution trend patterns as well as allowing easy installation. The ‘Tests Result Analyzer’ gives many different graphical representations and a quite detailed matrix table that will direct you to the outcome of each test for all the builds you’ve had. A reliable method of identifying unstable tests.
The ‘bootstrapped-multi-test-result-report plugin’ enables you to build HTML reports based on tests’ results. A major advantage of this plugin is its ability to make interactive reports that enable you to see the overall picture of all outcomes as well as detailed results of steps statuses.
Pipeline / Flow
This plugin allows users to describe tasks, handle scripts, and update Jenkins jobs. With Job DSL you can define jobs by bare minimum programmatic form with the help from templates. You also gain various jobs views such as ‘BuildMonitorView’, ‘BuildPipelineView’, ‘CategorizedJobsView’, and many others. These views provide high visibility of the status of selected Jenkins jobs.
This plugin provides a view of the jobs that make up your build pipeline, upstream and also downstream. Furthermore, it allows you to define manual triggers for specific tasks that may need intervention before their execution. Build Pipeline Plugin is a game changer for Jenkins’ users because it makes pipelines scriptable as well as providing an incredibly powerful avenue in which to develop complex DevOps pipelines.
This plugin allows you to express complex tasks and then organize them according to their structures in the Jenkins. You can use this plugin whenever you need to clean up the mess for chain definitions with upstream or downstream jobs. You may also use it when you need to create a hierarchy of tasks to be executed sequentially.
Upon its installation, you can create ‘Multijob’ projects, and also define phases that can hold more than one job in addition to executing jobs in parallel to each other.
‘Pipeline’ attempts to automate your continuous delivery pipeline and performs other complex tasks in Jenkins using traditional plugins and freestyle projects.
Source Control Management (SCM)
SCM allows for the referencing of multiple repositories in a Jenkins job.
This plugin syncs configuration files stored in the SCM hub and keeps track of any changes. It makes it possible for you to revert whenever you make an undesirable move. It also offers the option of using the repository as a reference to return to earlier positions manually.
Provides access to GitHub as an SCM which acts as a repository browser for many other providers.
This is the most fundamental plugin needed for integrating Jenkins with GitHub projects.With this plugin, you can schedule your build, pull code and data files from GitHub repositories to Jenkins, and automatically trigger each build as needed.
Finally, it is worth mentioning that Jenkins has hundreds of plugins that might be very useful for your current project. You may think that your current CI service is adequate and does not need additional plugins but it’s worthwhile to take some time and peruse over all plugins available from the Jenkins’ website. You are likely to spot some more plugins necessary for your project.
Caylent offers DevOps-as-a-Service to high growth companies looking for help with microservices, containers, cloud infrastructure, and CI/CD deployments. Our managed and consulting services are a more cost-effective option than hiring in-house and we scale as your team and company grow. Check out some of the use cases and learn how we work with clients by visiting our DevOps-as-a-Service offering.