HOWTO: Install Bamboo 3.4.3 (Continuous Integration server) on FreeBSD 9.0 RELEASE

Bamboo is a Continuous Integration server. It is used for automated building, testing, deploying, and releasing of your software.

FreeBSD is not among the officially supported platforms for Bamboo but all Atlassian's products work fine on FreeBSD. In this tutorial I'll describe how to install Bamboo v3.4.3 on FreeBSD 9.0 RELEASE.
 
(1) Install lang/perl5.14
Code:
# cd /usr/ports/lang/perl5.14
# make config-recursive
# make install clean

Do not forget to enable threads in the lang/perl5.14 configuration.

(2) Install java
Code:
# cd /usr/ports/java/jdk16
# make config-recursive
# make install clean

Remove ticks against "TZUPDATE" in the java/diablo-jdk16 and java/jdk16 configurations.

Put a tick against "JAIL" (if you build port in jail) in the java/jdk16 configuration.

You have to manually download few files:
Code:
# cd /var/ports/distfiles
# ftp http://www.java.net/download/jdk6/6u3/promoted/b05/jdk-6u3-fcs-src-b05-jrl-24_sep_2007.jar
# ftp http://www.java.net/download/jdk6/6u3/promoted/b05/jdk-6u3-fcs-bin-b05-jrl-24_sep_2007.jar
# ftp http://www.java.net/download/jdk6/6u3/promoted/b05/jdk-6u3-fcs-mozilla_headers-b05-unix-24_sep_2007.jar

By using your browser go to http://www.eyesbeyond.com/freebsddom/java/jdk16.html and manually download the latest BSD JDK 1.6.0 patchset and place it into /var/ports/distfiles.

Then restart the process:

Code:
# cd /usr/ports/java/jdk16
# make install clean

Soon you will be interrupted again. Download the file http://www.FreeBSDFoundation.org/cgi-bin/download?download=diablo-caffe-freebsd7-amd64-1.6.0_07-b02.tar.bz2
and place it into /var/ports/distfiles.

Then restart the process:

Code:
# cd /usr/ports/java/jdk16
# make install clean
 
(3) Download Bamboo server

Download Bamboo server (Standalone (TAR.GZ Archive) for Linux) into /tmp.

(4) Unpack into installation folder
Code:
# mkdir -p /usr/local/bamboo
# cd /usr/local/bamboo
# tar -xvzf /tmp/atlassian-bamboo-3.4.3-standalone.tar.gz

(5) Create bamboo user

Code:
# adduser
Username: bamboo
Full name: CI server
Uid (Leave empty for default):
Login group [bamboo]:
Login group is bamboo. Invite bamboo into other groups? []:
Login class [default]:
Shell (sh csh tcsh nologin) [sh]:
Home directory [/home/bamboo]:
Home directory permissions (Leave empty for default):
Use password-based authentication? [yes]:
Use an empty password? (yes/no) [no]:
Use a random password? (yes/no) [no]: yes
Lock out the account after creation? [no]:
Username   : bamboo
Password   : <random>
Full Name  : CI server
Uid        : 1003
Class      :
Groups     : bamboo
Home       : /home/bamboo
Home Mode  :
Shell      : /bin/sh
Locked     : no
OK? (yes/no): yes
adduser: INFO: Successfully added (bamboo) to the user database.
adduser: INFO: Password for (bamboo) is: XXXXXXXXXX
Add another user? (yes/no): no
Goodbye!

Adjust permissions on the directory where Bamboo has been installed:
Code:
# chown -R bamboo:bamboo /usr/local/bamboo
# chmod -R o-rx /usr/local/bamboo
 
(6) Configure bamboo server
Code:
# cd Bamboo/webapp/WEB-INF/classes

Open the file named bamboo-init.properties and setup home directory:
bamboo.home=/usr/local/bamboo/home

Create home directory:
Code:
# mkdir /usr/local/bamboo/home
# mkdir -p /usr/local/bamboo/Bamboo/log
# chown -R bamboo:bamboo /usr/local/bamboo/home
# chmod -R o-rx /usr/local/bamboo/home

Change permissions on the directory for logs:
Code:
# chmod -R g+w /usr/local/bamboo/Bamboo/logs

(7) Install shells/bash
Code:
# cd /usr/ports/shells/bash/ 
# make install clean
 
(8) Create startup script

Change in /usr/local/bamboo/Bamboo/bamboo.sh:
Code:
[color="Red"]-!/bin/bash[/color]
[color="Green"]+!/usr/local/bin/bash[/color]

Register auto startup script with crontab:
Code:
# su bamboo
$ crontab -e

Add the following line, and then save and exit:
Code:
* * * * * /usr/local/bamboo/bamboo-checker > /usr/local/bamboo/bamboo_laststate

Create /usr/local/bamboo/bamboo-checker:
Code:
#!/usr/local/bin/bash

JAVA_HOME=/usr/local/jdk1.6.0; export JAVA_HOME
CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar; export CLASSPATH
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/games:/usr/local/sbin:/usr/local/bin:$HOME/bin:$JAVA_HOME/bin; export PATH
PID=`/bin/ps waux | /usr/bin/grep java | /usr/bin/grep -v grep | /usr/bin/awk '{ print $2 }'`

if  ps waux | grep java | grep -v grep > /dev/null
 then
        echo "Java seems to run on PID $PID"
        exit
else
    echo "Java is not running. Starting BAMBOO"
    /usr/local/bamboo/Bamboo/bamboo.sh start
fi

Setup proper permissions:
Code:
$ chmod u+x /usr/local/bamboo/bamboo-checker
$ chmod g+x /usr/local/bamboo/bamboo-checker
$ chmod o-r /usr/local/bamboo/bamboo-checker
$ touch /usr/local/bamboo/bamboo_laststate
$ chmod g+w /usr/local/bamboo/bamboo_laststate
$ chmod o-r /usr/local/bamboo/bamboo_laststate
$ exit

(9) Change shell to nologin for user bamboo
Code:
# chpass -s /sbin/nologin bamboo

If you haven't experienced any problems until this line, then within 1 minute you will see with sockstat -4 that java has started on port 8085. Now you can use your browser to connect to this port and you will see the welcome page from Bamboo server.

Congratulations!

Please refer to Bamboo documentation for the configuration and usage details.
 
This is dead useful, and can be trivially adjusted to work for all Atlassian products. Thanks!

"FreeBSD is not a supported platform" my a**! :)
 
kchoudhu said:
This is dead useful, and can be trivially adjusted to work for all Atlassian products. Thanks!

"FreeBSD is not a supported platform" my a**! :)

Yes. I run Jira and Confluence on FreeBSD.
 
A port for JIRA is probably trivially doable. To get Fisheye and Crucible integration going, however, requires user intervention at an application level that I am scared of undertaking :)
 
I realise this is an extremely old post and I am sorry for resurrecting it but I have searched high and low and it seems this is the only instructional for Atlassian Bamboo on FreeBSD. This is probably a silly question since this post is 3 years old but do these instructions still work?
 
Back
Top