Monday, March 21, 2011

Hudson slave in remote windows machine

Here i am using hudson slave to run an automation script which is written using selenium. As my local machine is not having the required browser, best option before me is to use the hudson slave.

In my local machine the hudson console is opened using http://hudon_jack:8080

Steps to set up remote slave

1.Login in to remote machine.

2.Enter the following url into any browser

http://hudon_jack:8080/

If you are in some vpn or other network use the ip of the local machine.

http://local machine ip:8080/

3.From the "Manage Hudson" page click on "Manage Nodes".

4.Click on "New Node" to create a new slave node. Give a new name for node and save the settings.

5.Enter the details like "# of executers" and "remote FS root". "remote FS root" is the folder where user intends to set up the workspace. Under "Node Properties" user needs to specify the tools used for execution of the project. If maven is used specify the directory location of maven. Similar of the case of java.

There are various ways to start the slave agent. Here i will mention about starting a slave agent using jnlp.

6.Open cmd and execute this
java -jar slave.jar -jnlpUrl http://hudson_jack:8080/computer/slave_node_name/slave-agent.jnlp

Where slave_node_name is the name of the newly created slave node. Now a tcp/ip connection is established between slave and master.
slave.jar should be downloaded or it will be available in the folder assigned for slave.

Steps to run a test in slave

1. From the local machine open the hudson console.

2. Select the newly created slave job and check the radio button "Restrict where this project can be run" and give the name of the slave node just created.

Tuesday, March 15, 2011