BreadcrumbHomeResourcesBlog How To Install Jenkins Plugins October 25, 2023 How to Install Jenkins PluginsOpen Source AutomationDevOpsBy Vincenzo MarrazzoInstalling Jenkins plugins should be easy. In this blog, I will break down the basics of how to install Jenkins with plugins.But first, let's cover some Jenkins basics. Jenkins-CI is one of the most popular Continuous Integration (CI) tools. One of its main benefits is the flexibility it enables when configuring a Continuous Integration / Continuous Testing pipeline. This article will explain how to install Jenkins. I will provide practical examples for different Jenkins environment configurations according to use cases: for personal debugging, for your department and for Cloud deployment. Moreover, I will explain about resources consumption and which plugins are a "must have" in every installation.Table of ContentsWhy Do We Need Jenkins and Jenkins Plugins? How to Use Jenkins With PluginsHow to Install Jenkins PluginsUse Jenkins With BlazeMeterTable of Contents1 - Why Do We Need Jenkins and Jenkins Plugins? 2 - How to Use Jenkins With Plugins3 - How to Install Jenkins Plugins4 - Use Jenkins With BlazeMeterBack to topWhy Do We Need Jenkins and Jenkins Plugins? Which kind of activities can be executed with Jenkins? In theory, any SDLC activity (except assigning requirements, reading/ understanding requirements, coding requirements, coding unit/ component/ integration tests and committing code to version control).By properly defining a development strategy and configuring Jenkins accordingly, Jenkins can automatically handle many "accessory" phases of software governance (e.g. release). This flexibility is enabled by the rich plugin ecosystem, continuously developed on Jenkins. Moreover, the Jenkins platform allows defining a multi-executor architecture to answer various potential needs. Two of most simple architectures can be described as:Horizontal: many executors collaborate to handle parallel tasksVertical: Customized executors are dedicated to specific tasksThis provides both scalability and process isolation. Together with automation, this speeds up a lot of development processes and helps with code quality.Back to topHow to Use Jenkins With PluginsJenkins’s flexibility enables deployment and integration for multiple usage scenarios. Let’s see which ones.📕 Related Resource: Learn more about How to Use the Jenkins Performance PluginPersonal DebuggingInstalling Jenkins for personal debugging requirements can be useful during the early development stage of the CI chain. For example, when we need to provide practical evidence using a Proof of Concepts (POC) on how CI introduces Return Of Investment (ROI) on development tasks.Moreover we might have a CI chain already in place and in use, but we want to verify if the latest Jenkins build resolves bugs or introduces new expected features. It’s not recommended to alter production by adding a new Jenkins version without a preliminary investigation via a personal debug. The simplest way to install Jenkins is using the WAR file.Follow these steps:Install Java Runtime EnvironmentEnsure that java command is available on our shellDownload Jenkins WAR fileExecute commandjava -jar jenkins.warNow we have a running Jenkins instance running on our notebook ready to be used. This installation has the following features:listening on http://localhost:8080working folder on /.jenkins Prosquick to start/resetevery configuration file is on a local pathConsresource shared on the entire OSfew tasks in parallel firewall can be an issue3rd party software Typically this kind of installation does not include additional executors in addition to the main instance, because resources are limited.CI/CD for the Engineering Department Let’s say our CI process successfully completes the prototype stage and already produces important feedback that it shares procedures/reports with our coworkers. Let’s also say we have up to ten CI processes, each one focused on different aspects of the same product.However, the increasing complexity of CI chains is a new challenge for reliability and repeatability. Two tools can help us:Jenkins pipeline - for simplifying complex coding CI processes with a smart Domain Specific Language (DSL) derived by Groovy. Version Control Management integration tools - for natively fetching customized pipeline code from the Git repository.To include all the abilities listed above, follow these installation steps:Ensure you have a server that can easily be controlled from the departmentEnsure you have the necessary software installed (e.g. JRE and Git)Create a working directory for JenkinsDownload the Jenkins WAR fileDefine an environment variable JENKINS_HOME with the path from point 3JENKINS_HOME=/opt/jenkins_homeExecute the command:java -jar jenkins.warNow we have a running Jenkins instance running on our server, ready to be used for our department activities. This installation has the following features:listening to http://:8080the working folder on ${JENKINS_HOME} Prosquick setup backup and restore policies for Jenkins VMrunning many parallel tasks according resources3rd party software and hardware defined properlyConspreparation of server machine in labmight require additional IT skills for setting up the machine In this type of installation, the Jenkins instance becomes a part of your shared services over the network and it can interact with others, for example by using Git to retrieve pipeline code. Therefore, you can pair Jenkins with executor instances to obtain various goals, like assigning an executor with close coupling with a hardware device. You might need your IT colleagues to resolve issues like server configuration.Let’s see how to link executors to your Jenkins installation. The Executor is more and less a remote Java application on an external machine that interacts with Jenkins via socket (default value 50000). To install an executor we need two prerequisites:an external machine with the right network rules (e.g. allowing port 50000)Java Runtime Environment installedProceed as follows:Manage Jenkins -> Manage Nodes - New NodeInsert an identification name for the node and select “Permanent Agent”Fill “Remote root directory” field (e.g. “/var/jenkins_home” for a Linux executor)Click on the name of the newly created node in the node list panelFind a command like thisjava -jar agent.jar -jnlpUrl http://:8080/computer//slave-agent.jnlp -secret -workDir "/var/jenkins_home"Enter the executor machine shell and launch the command from point 5After a while, you will see the Jenkins instance availability of the new executorData Center DeploymentWhen our CI chain reaches a high level of maturity, the next step is to optimize business continuity and reduce the related operational costs by migrating Jenkins to the data center. This part typically involves extended support from the IT department, because the Jenkins installation becomes a corporate asset that requires Business Continuity policies (e.g. how to backup storage, server redundancy, scheduled update, etc.).A necessary step will be to add monitoring facilities to the Jenkins installation. This will enable catching abnormal operations that might negatively affect the service. An example can be the Monitoring plugin, but there are many more.The IT department can require technical support from the owner of the CI chain into early phases to provide accessibility to two kinds of software assets related to Jenkins-CI installation:configuration files necessary to execute tasks (e.g. config.xml into each task folder)information/documentation to configure the necessary modules, both internal (e.g. plugins) and external (e.g. custom Python shell, Git ssh key, etc.).After completing the necessary migration to the data center, we will have a running Jenkins instance integrated into the corporate infrastructure:listening on http://jenkins.:8080available everywhere using a proper VPNwith an existing task ready to be used${JENKINS_HOME} folder handled by IT department Prosmaintaining the Jenkins instance by corporate ITbackup and restore policies dedicate to Jenkins configuration filesmany parallel tasks according resourcesintegration with corporate services (e.g. LDAP, VPN)Conssuch important improvement requires planning with IT It’s important to also migrate the executors to avoid a conflict with the new Jenkins instance.Serverless Deployment in the CloudLike many other generic applications, Jenkins can also be executed without instantiating a dedicated server like the Data Center resources. Cloud Service Providers (CSP) can provide Infrastructure as a Service (IaaS) without affecting operational costs related to Jenkins machines. The blazing advantage is reduced operational costs and without maintaining a machine!The key to approach a serverless deployment is virtualization based on containerization. The same Jenkins instance does not see differences if it is:installed on a real machineor deployed on a virtualized environment that mimics a real machineThe latest scenario will use less resources and share hardware assets of various applications (e.g. machine, network connection, disk). To give a raw idea about cost saving on machine cost, take into account that renting a virtual machine can cost dozens times more than renting a single container at the same time. Moreover, containers natively support a redundancy strategy, to handle high volume and/or failure recovery. To provide an idea of the complexity of handling containers directly as an IaaS, let’s look at the Azure Cloud Shell. Make sure you’re subscribed to Azure services and that Azure Cloud Shell appears like a Linux-like shell. To obtain a running instance of Jenkins it is necessary to execute: az container create --resource-group DockerGroup --name jenkins --image jenkins/jenkins:2.235.1-lts --dns-name-label jenkins --ports 8080After execution, we need to identify the public host to interact with Jenkins as usual. We can launch the command:az container show --resource-group DockerGroup --name jenkins --query "{FQDN:ipAddress.fqdn,ProvisioningState:provisioningState}" --out tableAs the reader can understand, this command runs Docker. Docker shell is quite straightforward and enables deriving necessary commands in the Cloud shell (e.g. add a volume). There are some restrictions with Docker but they are not relevant for our kind of application. Prosmaintains Jenkins instance with corporate ITmaintains Jenkins machine with the Cloud Service Providerprovides backup and restore policies dedicates to Jenkins configuration filesrunning many parallel tasks according to resourcesintegration with corporate services (e.g. LDAP, VPN)Conssuch an important improvement requires planning with ITrequires knowledge of a solution based on IaaS What about executors? The executor can be ported to the CSP using a dedicated container. A more interesting scenario is when the executor continues to stay in the department network while the Jenkins instance is on the Cloud. In this latter scenario:the department network must allow connecting from the Jenkins cloud instancethe executor requires a first time installation to the new Jenkins instanceBack to topHow to Install Jenkins PluginsDuring the installation process Jenkins asks whether you want to install “suggested” plugins which should be sufficient for starting using it: version control and build systems integrations, pipelines, build agents, mail, user management, etc. It’s also possible to add more or remove unwanted plugins from the standard set. After the installation when Jenkins is up and running you will be always able to install new plugins or manage existing (enable, disable, upgrade, uninstall) from Manage Jenkins page:Or just open the Jenkins Plugins Manager page and you will be able to search for your favorite plugins there:If your Jenkins installation doesn’t have Internet access, it’s possible to browse the plugins via the Plugins page. Normally, there should be installation and configuration instructions for the plugins. Back to topUse Jenkins With BlazeMeterJenkins' killer feature is flexibility, and the installation procedure is no exception. Perhaps the real difficulty is deciding which kind of installation we need. Try to identify which of the proposed scenarios is the closest to what you need, and adapt missing parts. An incremental approach is probably the best way to familiarize yourself with Jenkins step by step.You can also run your BlazeMeter performance tests in Jenkins.START TESTING NOWThis blog was originally published on March 5, 2021. It has since been updated with new information.Related ResourcesHow to Install Jenkins on WindowsBack to top
Vincenzo Marrazzo Test Automation Specialist, Capgemini Engineering Vincenzo Marrazzo is a Test Automation Specialist. He has over 14 years of experience in various contexts both with open-source technologies and commercial ones. His primary activities are Test Automation and Performance Test. Vincenzo currently works at Capgemini Engineering Italy.