Friday, February 24, 2017

Jenkins - Cloning an existing job in jenkins

We can clone an existing job in Jenkins using the steps below. Copying a Jenkins job is useful in case there is minor changes in the two job configurations.

Steps to be followed:
  • In Jenkins, we can see all the existing jobs in the dashboard and option to create a new job by clicking on New Item
Jenkins - cloning existing job
  • On clicking on new Item, a new page will be displayed to select project type and name of the item. Provide the name for the item.

Jenkins - cloning existing job
  •  In the bottom of the page, there is a option to copy from existing item. Provide the existing job name and click on OK.
Jenkins - cloning existing job
  •  The new job will be created and displayed in the dashboard. Make necessary changes in the job and save.
Jenkins - cloning existing job

 

Friday, December 23, 2016

Install Jenkins as a Windows service

Once we have installed the jenkins setup, we need to launch jenkins.war file manually before accessing jenkins as shown below. To avoid running jenkins.war manually to start jenkins, we can install jenkins as a window service.


Steps to install Jenkins as window service:


1. From the localhost jenkins machine, run the jenkins.war files as shown above.

2. Once Jenkins is up and running, open localhost:8080 in the browser.

3. Go to Manage Jenkins> Install as Windows Service.

4. Follow steps in below screenshot to install Window Service.


5. Go to run>services.msc. Jenkins should be installed as a service.


How to configure jenkins for user access without login authentication

In the previous article, we explain how to install Jenkins.  Jenkins setup on localhost server
Once Jenkins is installed, we can connect to Jenkins from localhost:8080 or <ServerName>:<Port Number> from the browser.

Once we open the url, It asks for username and password to connect to the jenkins server. In most cases, we require username/Password authentication to connect to the jenkins server as shown below:
:


However, In case we want everyone gets full access to the system and do not need to login , We can skip user authentication using below steps:
  • Navigate to .jenkins folder (Location: c:\users\<user acc>\.jenkins)
  • Open config.xml file in the folder.
  • set element<useSecurity> value as false.
  • Remove elements authorizationStrategy and securityRealm as shown below:
  • Restart Jenkins
  • Once Jenkins restart, acess localhost:8080 (check if port is same or different in your jenkins)
  • It will not ask for Username and password as shown below and jenkins dashboard will be displayed as shown below