Wednesday, August 09, 2006

Installing Jira and Perforce Plugin

This is my first assignment after a very long time.

Jira is a Bug Tracking tool similar to bugzilla.

Since we are using Perforce which is similar to CVS .

We are planning to Integrate Jira with Perforce Plugin to be able to track versions.


Heres what I have done to get this running :

Jira Installation and Perforce Plugin Installation:
===================================

Jira Installation
1) Check if Java is Installed - ps -ef grep java

2) Export JAVA_Home to where you are Installing Jira
$cd /opt/Jira
$export JAVA_HOME=/usr/java/jdk1.5.0_06/

3) Download atlassian-jira-standard-3.6.3-standalone.tar.gz

4) Untar it in /opt/Jira
$tar -zxvf atlassian-jira-standard-3.6.3-standalone.tar.gz

5) By Default Jira runs on 8080 port you can change it to whatver port you want.
For eg. In our case we have changed it to 8090

Change the below two settings in
/opt/Jira/atlassian-jira-standard-3.6.3-standalone/conf/server.xml
1) Server Port "8005"
2) Connector Port "8090" <---- Port Jira Connects

6) Now Start Jira
/opt/Jira/atlassian-jira-standard-3.6.3-standalone/bin/startup.sh

To Stop Jira
/opt/Jira/atlassian-jira-standard-3.6.3-standalone/bin/shutdown.sh

7) Now Point your Browser to
http://Jira_host:8090

8) This will ask you some some questions to complete Jira Installation and a next will add a Jira Administrator.

To Obtain a Evaluation License Key (Below Link)
http://www.atlassian.com/software/jira/Licenses.jspa


Perforce Plugin Installation :
=====================

Note - Please make sure you have Installed Perforce command line tool before you Install Perforce Plugin for Jira.
You can find the P4 command Line tool from the below link
http://www.perforce.com/perforce/downloads/linux26x86.html

1) Download atlassian-jira-perforce-plugin-1.1.5.zip

2) Unzip it in /opt/Jira

3) Copy the below files from /opt/Jira/atlassian-jira-perforce-plugin-1.1.5
- atlassian-jira-perforce-plugin-1.1.5.jar
- p4package-rev13.jar

To - /opt/Jira/atlassian-jira-standard-3.6.3-standalone/atlassian-jira/WEB-INF/lib

4) Edit perforce-jira-plugin.properties from /opt/Jira/atlassian-jira-perforce-plugin-1.1.5
p4.executable=/opt/Jira/p4

Most of the Information regarding p4port , User, Pass were all Hashed in my case as I did not have the Info.

I had also hashed the Logging Entries.

5) Now copy perforce-jira-plugin.properties
To - /opt/Jira/atlassian-jira-standard-3.6.3-standalone/atlassian-jira/WEB-INF/classes

6) I have not copied any Licence for Plugins as per there Docs.

7) Restart Jira
TO see if plugin is Installed Login to Jira Web based Under Administration section > System > Plugins

It Should have Installed 7 Modules.

rm command - Argument List too long

Some days back I had problems deleting n no of files in folder.

while using rm command it would say

$rm -f /home/sriram/tmp/*.txt
-bash: /bin/rm: Argument list too long

This is not a limitation of the rm command, but a kernel limitation on the size of the parameters of the command. Since I was performing shell globbing (selecting all the files with extension .txt), this meant that the size of the command line arguments became bigger with the number of the files.

One solution is to to either run rm command inside a loop and delete each individual result, or to use find with the xargs parameter to pass the delete command. I prefer the find solution so I had changed the rm line inside the script to:

find /home/$u/tmp/ -name '*.txt' -print0 xargs -0 rm

this does the trick and solves the problem. One final touch was to not receive warnings if there were no actual files to delete, like:

rm: too few arguments

Try `rm --help' for more information.

For this I have added the -f parameter to rm (-f, –force = ignore nonexistent files, never prompt). Since this was running in a shell script from cron the prompt was not needed also so no problem here. The final line I used to replace the rm one was:

find /home/$u/tmp/ -name '*.txt' -print0 xargs -0 rm -f

You can also do this in the directory:
ls xargs rm

Alternatively you could have used a one line find:

find /home/$u/tmp/ -name ‘*.txt’ -exec rm {} \; -print


Thanks to him