February 10, 2013

Jenkins - Uninstallation Server & Slave

 Here is the straight forwards steps to uninstall Jenkins Server and Slave software from the machine.

Jenkins Server uninstallation:

  •  Go to Add / Remove programs and remove Jenkins (Major.MinorVersion). 

Jenkins Slave uninstallation:

  1. Login to the machine where Jenkins Slave is installled and run “sc delete jenkinsslave-D__Software_jenkinsslave” from command prompt to delete the Jenkins Slave service.
  2. Restart the machine and verify that the Jenkins Slave Windows Service is deleted.
  3. Delete D:\Software\jenkinsslave on the Jenkins Slave machine.
The above Slave uninstallation steps comes handy to remove the current instance completely in case of any issues.

Refer here for Jenkins - Installation & Configuration.

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

February 6, 2013

Mind Mapping Software - FreeMind

What is Mindmapping all about?
Mindmapping is the process of drawing up diagrams that show relations between various ideas, tasks or information. Concept-mapping and mind-mapping are similar in the way it connects concepts / topics via graphs but with a difference. This article provides crisp information on Mindmapping and a free tool that aids you to map your thoughts.

How is it useful?
When you are part of brainstorming sessions, by drawing mind maps you actually visualize your tasks and how each task can influence each other in a better way, making your brain remember more easily and/or come up with new ideas.
Further if you are running short of time to make an appealing presentation, a quick MindMap can portray your thought process. In general, it can be used to organize things more efficiently with a visual and structural touch.

Add caption
Freemind is an open source, cross-platform mind mapping software. You can download the latest installable for Windows or supported platform from here.
You may wonder why FreeMind, when you have several other mind mapping software?
I prefer FreeMind for the following features plus it lets you to play around only with keyboard. Yes, most of  the actions are mapped with a key board shortcut.

  • Folding branches
  • Save files as XML -- in mm file format
  • Export hypertext to HTML and XHTML
  • Export document to PDF and OpenDocument
  • Exports image to PNG, JPEG and SVG
  • Icons on nodes
  • Clouds around branches
  • Graphical links connecting nodes
  • Search restricted to single branches
  • Web and file hyperlinks from nodes
  • FreeMind browser/player for web in Java or Flash
  • Transform maps using XSLT

  • Here is a simple Mind map created using FreeMind to represent few departments in a company
     Here you go with miniature (but zoomed-in for better view) of the image with the folded nodes.
    Never mind even if you are technically challenged, countable keyboard shortcuts will help you to do wonders.
    Thanks to Ram for jubilantly sharing this Cool Tool.

    February 4, 2013

    Ant: Did you know that using arg 'value' instead of arg 'line' will have an impact?

    We heavily use Ant scripts for Build automation and it came as a big surprise that using arg 'value' instead of arg 'line' will have an impact. This article will focus on the problem statement that had issues and the Solution for the same.

    Problem Statement:

    There were two issues as detailed below while creating the Tags the Ant Script.
    1) When the SVN authentication credentials are saved

    -->The below script is creating a directory with the time stamp but its including the username and password also in the directory name (e.g  "20130130_044807 --username testuser --password testpass")
    -->We tried with many options but it's still taking the username and password in the directory name.
    --> Tagging is working properly.
    <?xml version="1.0"?>
    <project name="samplescript" default="TagSource">
    <property name="SVN_UNAME" value="testuser"/>
    <property name="SVN_PWD" value="testpass"/>
    <property name="SVN_LOGIN" value="--username ${SVN_UNAME} --password ${SVN_PWD}"/>
    <property name="SVN_TAG_MSSG" value="tagging"/>
                    <format property="TODAY" pattern="yyyyMMdd"/>
                          <format property="NOW" pattern="HHmmss"/>
     <property name="svn_dir" value="${TODAY}_${NOW}"/>
     <echo> ${svn_dir} </echo>
     <property name="SVN_URL" value="http://url/trunk/${svn_dir}"/
     <echo> ${SVN_URL} </echo>
    <target name="TagSource" description="Creating a directory and tagging the working copy" >
       <exec executable="svn">
                    <arg value="mkdir"/>
                    <arg value="${SVN_URL} --username ${SVN_UNAME} --password ${SVN_PWD} " />
                    <arg value="-m Creating_dir" />
       <exec executable="svn">
                    <arg value="copy"/>
                    <arg value="D:\backup\SQL\xsl" />
                    <arg value="${SVN_URL} --username ${SVN_UNAME} --password ${SVN_PWD} " />
                    <arg value="-m tagging" />
    2) When the SVN authentication credentials are not saved:
    -->The same above script is failing with the below error:
         [exec] Authentication realm: <http://url:80> Subversion Repo 
    The main issue here is It's not considering the username and password provided in the script.
    Instead of the following statement,
    < arg value="${SVN_URL} --username ${SVN_UNAME} --password ${SVN_PWD} " />


    < arg line="${SVN_URL} --username ${SVN_UNAME} --password ${SVN_PWD} " />

    arg value treats entire value as single command separated by space.
    arg line will consider this as separate command delimited by space.

    Thanks to Mayur Bhatt for the solution.