In this article, we will see what Jenkins software tool is all about and also look into its installation process on a Windows-based machine. Firstly let us understand what Jenkins is all about and why / where this software tool can be put to use?
Jenkins is a very powerful automation platform that makes it relatively easy to automate the build process (through ANT), regression testing and also the integration. There are quite a few reasons why you would want to do this, as mentioned below:
1) It helps the developer’s time is focused on things that matter. With newer code blocks added to the same functionality, your developer doesn’t need to worry further on testing it as running regression tests with Jenkins is pretty simple. This means that developer time is not compromised with something that is not required.
2) It helps in the improvement of software quality. With Continuous integration, identifying issues caused by newer check-ins can be identified and resolved earlier than being reported at a later stage of design and development.
3) It ensures faster development, as the likelihood of any integrations issues is lesser and also the whole part of integration is also automated.
1) The points mentioned above are good enough reasons for someone not using Jenkins in their development ecosystem to use it, but let us take a look into its advantages further to cement its requirement:
2) Jenkins is a tool that is available open source with strong community support.
3) Jenkins installation is much easier.
4) Jenkins has a surplus of 1000 and counting plug-in’s support.
5) Jenkins provides a provision to create a new Jenkins plugin if one is not available.
6) Jenkins is written in Java, hence its easier portability on almost all the major platforms.
The basic pre-requisite to install Jenkins is to have the Java installation proper. You can cross-check your Java installation if it is proper or not with just checking the version of the Java installed using this command.
Then download the latest Jenkins WAR file from the Jenkins download page to go further with the installation.
If you have installed Jenkins using the windows MSI based installer, then there is no need to do anything in specific here as the windows MSI based installer automatically runs Jenkins as a windows service (should be available in your Windows Services by default).
If you have come down to this point, then it means that you are not running the Windows installer. Then, you need to start Jenkins before even installing it. This can be either done from JNLP, or by running the command below
java -jar jenkins.war
Once the step above is done, you can now connect to Jenkins via the following URL
Once Jenkins is started this way, look for the "Install as Windows Service" link in the "Manage Jenkins" page (as shown in the screenshot below). A point to note here is that, if the service is already running as a service then this option will not be shown on the Manage Jenkins page of your corresponding Jenkins installation on your Windows machine.
Click on the highlighted section on the Manage Jenkins page on your local Jenkins installation (on a Windows machine), takes you to the page where you need to provide the path where you need to install Jenkins. Please follow the screenshot below to understand the same.
In the text box available, as per the screenshot above – please provide the path where Jenkins needs to be installed. The folder path should already be existing for the installation to work, if the folder mentioned doesn’t exist then you need to create those respective folders beforehand. This same path should be provided as the environment variable JENKINS_HOME later.
JENKINS_HOME = C:jenkins
Once the path is mentioned, you may proceed to click on Install. Upon successful installation of Jenkins on your Windows machine, you would get a confirmation message to restart Jenkins, proceed to click on Yes to restart it will relaunch Jenkins as a newly installed Windows service (as shown in the screenshot below).
Once the restart is successful, you can check on your Windows Services application to check that there is a newly created Windows service by name Jenkins. Please see the screenshot below for the same.
This completes our Jenkins installation on a Windows machine as a windows service. You could now use your Jenkins instance by either starting or stopping it as required from the Service application on your Windows machine.
The JVM launch parameters of the related Windows services (with respect to Jenkins) are controlled by a couple of XML configuration files namely jenkins.xml and Jenkins-slave.xml respectively. These files would be present in the $JENKINS_HOME folder and in the slave root directory respectively after these are both installed as Windows services. We can tweak the arguments available in the configuration files to give the JVM bigger memory or etc.
stdout and stderr from these service processes get logged in to log files present in the same directory.
In this article the basics of Jenkins and the prerequisites that are required for the Jenkins installation on a Windows machine. Hope this article was clear enough and has helped you in successfully installing Jenkins on your Windows machine are provided in great detail. Jenkins is a software tool written in Java, so it should be working on almost all the environments and should help you get further on your Continuous Integration with any codebase of your choice.
Free Demo for Corporate & Online Trainings.