PDA

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


vand777
January 29th, 2012, 21:13
Bamboo (http://www.atlassian.com/software/bamboo/overview) 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.

vand777
January 29th, 2012, 21:21
(1) Install lang/perl5.14 (http://www.freshports.org/lang/perl5.14)

# cd /usr/ports/lang/perl5.14
# make config-recursive
# make install clean


Do not forget to enable threads in the lang/perl5.14 (http://www.freshports.org/lang/perl5.14) configuration.

(2) Install java

# cd /usr/ports/java/jdk16
# make config-recursive
# make install clean


Remove ticks against "TZUPDATE" in the java/diablo-jdk16 (http://www.freshports.org/java/diablo-jdk16/) and java/jdk16 (http://www.freshports.org/java/jdk16) configurations.

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

You have to manually download few files:

# 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 (http://www.eyesbeyond.com/freebsddom/java/JDK16JRLConfirm.html) and place it into /var/ports/distfiles.

Then restart the process:


# 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
(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:


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

vand777
January 29th, 2012, 21:27
(3) Download Bamboo server

Download Bamboo server (http://www.atlassian.com/software/bamboo/download?os=linux) (Standalone (TAR.GZ Archive) for Linux) into /tmp.

(4) Unpack into installation folder

# mkdir -p /usr/local/bamboo
# cd /usr/local/bamboo
# tar -xvzf /tmp/atlassian-bamboo-3.4.3-standalone.tar.gz


(5) Create bamboo user


# 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:

# chown -R bamboo:bamboo /usr/local/bamboo
# chmod -R o-rx /usr/local/bamboo

vand777
January 29th, 2012, 21:33
(6) Configure bamboo server

# 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:

# 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:

# chmod -R g+w /usr/local/bamboo/Bamboo/logs


(7) Install shells/bash (http://www.freshports.org/shells/bash)

# cd /usr/ports/shells/bash/
# make install clean

vand777
January 29th, 2012, 21:40
(8) Create startup script

Change in /usr/local/bamboo/Bamboo/bamboo.sh:

-!/bin/bash
+!/usr/local/bin/bash


Register auto startup script with crontab:

# su bamboo
$ crontab -e


Add the following line, and then save and exit:

* * * * * /usr/local/bamboo/bamboo-checker > /usr/local/bamboo/bamboo_laststate


Create /usr/local/bamboo/bamboo-checker:

#!/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:

$ 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

# 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 (http://confluence.atlassian.com/display/BAMBOO/Bamboo+Documentation+Home) for the configuration and usage details.

vand777
January 29th, 2012, 21:41
Reserved1

vand777
January 29th, 2012, 21:42
Reserved2

vand777
January 29th, 2012, 21:42
Reserved3

vand777
January 29th, 2012, 21:42
Reserved4

kchoudhu
April 8th, 2012, 10:13
This is dead useful, and can be trivially adjusted to work for all Atlassian products. Thanks!

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

vand777
April 10th, 2012, 17:05
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.