Monday, 28 October 2013

How to setup Hudson

Building/testing software projects continuously, just like CruiseControl or DamageControl. In a nutshell, Hudson provides an easy-to-use so-called continuous integration system, making it easier for developers to integrate changes to the project, and making it easier for users to obtain a fresh build. The automated, continuous build increases the productivity.

Monitoring executions of externally-run jobs, such as cron jobs and procmail jobs, even those that are run on a remote machine. For example, with cron, all you receive is regular e-mails that capture the output, and it is up to you to look at them diligently and notice when it broke. Hudson keeps those outputs and makes it easy for you to notice when something is wrong.

# wget
# /etc/init.d/hudson start

# ps -ef | grep hudson | grep -v grep
hudson    5521     1  0 21:37 ?        00:00:36 /usr/lib/jvm/java-1.6.0/bin/java -Dcom.sun.akuma.Daemon=daemonized -Djava.awt.headless=true -DHUDSON_HOME=/var/lib/hudson -jar /usr/lib/hudson/hudson.war --logfile=/var/log/hudson/hudson.log --daemon --httpPort=8080 --debug=5 --handlerCountMax=100 --handlerCountMaxIdle=20

-----> Try Hudson locally : http://localhost:8080 and install whatever plugins and more you need.
 or  --------> 8080 default port

Changing hudson Default port

Hudson normally starts up using port 8080, however, if you have other web services starting up, you might find that this port is already taken, you can specify a different port by using either command line or else edit the file hudson.

# vim /etc/sysconfig/hudson  -----> change port here
# Hudson Home Directory:- /var/lib/hudson/

OPtions in Hudson Interface

1. Manage Hudson
1.1 Configure System(Configure global settings and paths here)

 we can give a system message,Email notification,Enable security and other parameters for the running jobs here.

Enabling Password For Hudson
Some Important files are:-

# cd /var/lib/hudson/
   vim config.xml ---> we can get username here/we can disable authentication from this file/
# cd /var/lib/hudson/users/tech
  vim config.xml
    <passwordHash> </passwordHash> --------> password will be there in between this tag, remove the encrypted password to disable password for that user.

1.2. Manage Plugins ----> plugins that can extend the functionality of Hudson

1.3 System Information ---->  Displays various environmental information to assist trouble-shooting.

1.4 System Log  ------> System log captures output from java.util.logging output related to Hudson. By using a log recorder, you can group related logs into one file for easier inspection,
and by using multiple log recorders, you can create multiple such groups.

Creating a new View and Job in Hudson ( If you want to execute a shell script or any other job )

1. Create a "New View". Fill View name, enable List view, ok, get a new window either you can configure any item there or just give ok.

2. After Creating a New View create a "New Job". Fill job name, and enable "Build a free-style software project" and ok. It will take to another window go down there is a header "Build" and select "Execute Shell" from drop down list, and give the shell scripts path here ( sh /opt/scriptname ) and Save it.

3. Then go to the View and "Schedule a build" this will execute the script build. and you can view the output in the console.

Look at some screen shoots below,

No comments:

Post a Comment