Wednesday, 19 October 2016

Jenkins with Windows #3

Continuing my last posts (Jenkins with Windows #1 & Jenkins with Windows #2)..I am adding some more tips or solution with Jenkins installation.

Install Jenkins as a Windows service - 
You can follow the Jenkins Wiki page to create a windows service for jenkins so whenever you have to start/stop/restart, you no need to open a command prompt and type some commands.
It will install as a service in windows which you can see in services (services.msc).  Please find the page link as below -

Jenkins Wiki Page Link - Install Jenkins as a Windows service

Configuring Jenkins as a Windows service -
When you install jenkins as windows service, you have to change/check jenkins.xml file created in JENKINS_HOME directory.

If you are using port other than 8080, Do the below changes in jenkins.xml Else leave as it is.

    if you'd like to run Jenkins with a specific version of Java, specify a full path to java.exe.
    The following value assumes that you have java in your PATH.
  <arguments>-Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "%BASE%\jenkins.war" --httpPort=9090 --webroot="%BASE%\war"</arguments>

Change the httpPort to port where you want to run your jenkins and then restart the jenkins service. Now you can access jenkins on http://localhost:9090

Like the below page to get update