Let’s get started with Jenkins

Monil Joshi
8 min readFeb 3, 2022

--

Whenever we heard word Jenkins, first word comes in to out mind is CI/CD. Why this comes in to our minds? What is CI/CD? Before answering these questions first we should know what is Jenkins? Is it only limited to CI/CD

What is Jenkins?

According to official document it is an open source automation server which enables developers around the world to reliably build, test, and deploy their software. There are different ways you can install Jenkins depends on where you want to install it. It can be installed through native system packages, on docker or even standalone on any machine.

How to install Jenkins as Standalone application.

Before installing Jenkins we need to things on machine.

  1. Java
  2. Jenkins’s war file

Check java installed on machine using below command in command prompt

java -version 

Next step is to download Jenkin’s war file

  1. Go to https://www.jenkins.io/
  2. Click on Download
  3. We will be redirecting to download Jenkins page
  4. The Jenkins project produces two release lines on is stable also known as long term support (LTS) & regular also known as weekly
  5. We will go for LTS version of Jenkins
  6. Here you can see all the platform where you can install Jenkins

7. We will download Generic Java Package (.war)

8. Go to location where war file is downloaded.

9. Open Command prompt and hit below command

java -jar jenkins.war

10. Here you might face a challenge if your automation framework demands java 8 version latest Jenkins might give you an error

11. In this case, download Azul java 11 or higher.

12. Keep it in drive or downloads

13. In the above command “java -jar” instead of java keyword provide complete java path till java.exe

14. Hit Enter and it will initialise installation process.

15. One of the logs will tell you where Jenkins server is running on your machine. Search “Started ServerConnector” and check for the port. By default it runs on port 8080. So your jenkins URL is http://localhost:8080/

16. At the end process it will show a password which will be used as initial password for Jenkins on your machine. It also shows you where you will find this password on your machine.

17. Once installation is completed . Open Browser and hit http://localhost:8080. It will redirect to page where you will have to provide initial password.

18. Copy paste initial password you are having with you

19. Next screen will gives you customised your Jenkins. You can either select an option installed suggested plugins or select only required plugins

20. As I do not have any particular requirement I am going for first option Installed suggested plugins

21. Once all the plugins get installed it will land you to a page where you can create First User.

22. You can skip and continue with admin but it is recommended to create and set user. In case you skip, next time use username as admin and initial password you have used above as password to log in.

23. On the next screen you have confirm Jenkins URL

24. Once you click on save and Finish you will land on home page of Jenkins

We will see each option one by one.

New Item: This option is use to create new project or jobs in Jenkins. Any new job is called new item. Click on New item and see. You can create Jenkins project as per requirement. For example you want to simple Jenkins job to execute your automation suite you can create Freestyle project and configure it. It will do your job. If you want to execute same suite with different configuration you can use multi-configuration job. Like wise you can create project on based on your need.

New Item

People: This section is the user section who has registered to particular Jenkins server. Note that, this tab only give information about people register to Jenkins server and not the people who are actual contributing to the projects

People

Build History: This show you build history. It shows a list of your past builds, time since build executed and the status of each build. You can navigate to individual job for detail analysis for each one of them.

Build History

Manage Jenkins: This is brain of Jenkins. Name Manage Jenkins is explanatory. You can perform standard administrative tasks in the Manage Jenkins section of the dashboard.

It has few section grouped logically. Top section is filled with notifications about latest available Jenkins version, Plugin information which is installed and deprecated, Stored data mis-matched, Warnings for installed plugins, Security updates or warnings

Second Layer is of System Configuration group. These configurations help to configure resources for your Jenkins instance. These are the options grouped under System Configuration

  1. Configure System: You can configure global settings and paths for the Jenkins instance
  2. Global Tool Configuration: You can Configure tools, their locations, and automatic installers
  3. Manage Plugins: This option helps you to add, update, remove, disable/enable plugins that extend the functionality of Jenkins. If you click and go inside you will get sophisticated options for plugins filter out based on Updates (plugin with update available) Available but not installed plugin, Installed plugin by user, Advanced tab to import plugin.
  4. Manage Nodes and Clouds: This option helps you to add, remove, control, and monitor the nodes used for the agents on which build jobs run.
System Configuration group

Third layer is of Security group: These configurations help to configuring security features for your Jenkins instance.

  1. Configure Global Security: You can set configuration parameters to secure your Jenkins instance.
  2. Manage Credentials: You can configure the credentials to secure access to third-party sites and applications that interact with Jenkins.
  3. Configure Credential Providers: You can configure credential providers and types here
  4. Manage Users: You can manage users defined in the Jenkins user database. This is not used if you use a different security realm such as LDAP or AD. You can Create/Delete/modify users that can log in this Jenkins
Security

Status information group:

  1. System Information: It displays information about the Jenkins environment.
  2. System Log: These are Jenkins log that contains all java.uil.logging output related to Jenkins.
  3. Load Statistics: It displays information about resource utilization on you Jenkins instance.
  4. About Jenkins: It provides version and license information for your Jenkins instance.
Status Information

Troubleshooting Group: It manages old data. It removes configuration information related to plugins that have been removed from the instance.

Troubleshooting

Tools and Action group: This group help for common management tasks and management tools that enable you to do administrative tasks without using the UI.

  1. Reload Configuration from Disk : It discards all data loaded in memory and reload everything from the file system. This is useful when you modify configuration files directly on disk.
  2. Jenkins CLI: Jenkins CLI (Command Line Interface) which tells us how to use Jenkins from a shell or script.
  3. Script Console: We can execute an Apache Groovy script for administration, troubleshooting, and diagnostics.
  4. Prepare for Shutdown: It prevents new builds from starting so that the system can be shut down safely.
Tools and Action

Uncategorised group: This will list down plugins that have not yet declared the category of their page. Here you can see we have Editable Email Notification Templates.

My View: This view will show all the jobs in Jenkins for which current logged in User has access to.

My View

Lockable Resources: This plugin allows use to define lockable resources such as printers, phones, computers, etc. that can be used by builds. If a build requires a resource which is already locked, it will wait for the resource to be free.

New View: You can customised your view using this option and decide how would you like to see. It has radio option for my View, List View and if you any other type of job it will list down as View for example MultiJob View.

My View: This is the same view we saw above

List View: Shows items in a simple list format. You can choose which jobs are to be displayed in which view.

You can provide name to your view and select view you would like to see your jobs

New View

Husshh !! Lot of information right ? Don’t worry. You do not have to use this at once. We will go step by step on how can we use Jenkins features to get maximum benefit out of it. In next few article we will explore Jenkins in details and see how it will help us to achieve continue integration and reduce manual intervention of out test execution.

In the next article we will see how to create free style project and configure Selenium Test.

Stay Tuned and Happy Reading!!!

--

--

Monil Joshi

I am having an 8+ years of experience in software testing. Working with Web, Mobile and API technologies. Visit my GIT https://github.com/monilj