February 8, 2013

Jenkins - Installation & Configuration


This article focus on the steps involved in setting up Jenkins Server and Slave on Windows Operating system using Windows native Package.

Jenkins Server Installation:
  1. Download Windows native Package here.
  2. Extract and run the setup.exe on your proposed Jenkin Server Machine.
  3. URL -> http://JenkinsServerURL:8080/ will be launched at the end of installation and a Windows Service named "Jenkins" will be created (verify the same from Services.msc).
  4. Go to Manage Jenkins -> Manage Plugin -> Available Tab and download and install the required plugins. The following list gives you the basic list of plugins where you need to have multiple nodes, multiple jobs - some to be run parallelly and / or sequentially
·         Dashboard viewBuild Pipeline Plugin
·         Jenkins descriptor setter plugin
·         Green Balls
·         Jenkins Multijob Plugin
·         Jenkins Promoted Build Plugin
·         Jenkins Parameterized Trigger plugin (this is mandatory for Jenkins Multijob Plugin)
·         Mask Passwords Plugin
·         build-name-setter
·         Token Macro Plugin
·         Node and Label Parameter Plugin
·         Log Parser plugin
·         Jenkins Workspace Cleanup Plugin
·         Jenkins Email Extension Plugin

5.   Changing the http port number -> Edit <Jenkins InstallDir>\Jenkins.xml to set the httpport as 80, Save and retart Jenkins Server.

6.   If you do not have internet access in the Jenkins Server, Download the Plugins on your local box and upload to Jekins Server by browsing through the URL.

Go to Manage Jenkins -> Manage Plugin -> Advanced -> and browse to the plugin that needs to be uploaded. 

Click Install without restart to install the plugin (You can restart the Jenkins Windows Service if required).
 

Jenkins Server Configuration:

1.   Go to Manage Jenkins -> Configure System and update Jeinkins Location• example - Jenkins URL - http://JenkinsServerURL/ and provide System Admin e-mail address.

2.   Go to Manage Jenkins -> Configure Global Security and select "Enable Security" checkbox

·         Choose Fixed for TCP port for JNLP slave agents and set its value to 18000 (a random number)

·         By default Authorization mode is "Anyone can do anything" and you can change on need basis.

3.   Open two ports HTTP (80/tcp) and 18000/tcp for all the Jenkins Agents to access the Server via these Ports.

4.   Go to Manage Jenkins -> Manage Node to Add, Remove and Monitor Nodes. Add a Node and set the “Remote FS root” pointing to “JenkinsSlave Installation Directory” on Node

Jenkins Slave Installation:

1.     Prepare Semi-automated installations for Jenkin Slave
·         Login in to Jenkins Server machine
·         Copy jre folder & its content from Jenkins Server installation directory to D:\Jenkins_Slave.
·         Create a file named InstallJenkinSlave.bat under D:\Jenkins_Slave and copy the following
set JRE_PATH=d:\software\jre_jenkins\bin

xcopy /E /I \\jenkinsserver\d$\Jenkins_Slave\jre d:\software\jre_jenkins

:: Setting System wide Path for Jenkins JRE
setx path "%JRE_PATH%;%path%" /m


2. Install Jenkins Slave
·         Login into proposed Jenkins Slave installation machine.
·         Run \\jenkinsserver\d$\Jenkins_Slave\InstallJenkinSlave.bat from the command prompt
·         You will get the below application launched.
 
·         Click "Install as a service" to proceed.
·         Click "OK" in the message box "This will install a slave agent as a Windows service, so that a Jenkins slave starts automatically when the machine boots. When the installation is over, this slave agent will exit to let the new service take over."
·         You will get the error as “WMI.WmiException: StatusServiceExists", if service is already installed. Otherwise the installation proceeds without any error.
·         This completes Jenkins Slave Installation and a Windows Service named "Jenkins Slave" will be created

No comments:

Post a Comment