Friday, 7 December 2018

Atlassian Bamboo Installation and configuration

In this tutorial we will cover installation and configuration of Atlassian Bamboo on CentOS 7.X machine.

1) Install openjdk on target machine.
yum install java-1.8.0-openjdk -y

2) Install PostgreSQL on target machine. Bamboo installation will choose PostgreSQL database by default. By default JDBC driver for PostgreSQL server bundled with Bamboo.

yum install postgresql* -y

3) Please create bamboo database and user on PostgreSQL.

CREATE DATABASE bamboo;

create user admin with encrypted password 'admin';

grant all privileges on database bamboo to admin ;

4) Create application user.

useradd --create-home -c "Bamboo role account" bamboo

5) Download bamboo and install.

mkdir -p /opt/atlassian/bamboo

chown bamboo: /opt/atlassian/bamboo

ls -ld /opt/atlassian/bamboo

su - bamboo

cd /opt/atlassian/bamboo

wget https://www.atlassian.com/software/bamboo/downloads/binary/atlassian-bamboo-5.10.3.tar.gz

tar -zxvf atlassian-bamboo-5.10.3.tar.gz

ln -s atlassian-bamboo-5.10.3 current

mkdir -p /var/atlassian/application/bamboo

chown bamboo: /var/atlassian/application/bamboo/

Update Bamboo home path (bamboo.home=/var/atlassian/application/bamboo) in bamboo-init.properties
vi current/atlassian-bamboo/WEB-INF/classes/bamboo-init.properties

7) Start Bamboo.

bin/start-bamboo.sh

please check bamboo process

ps aux | grep bamboo

8) Create init script.

vi /etc/init.d/bamboo

#!/bin/sh
set -e
### BEGIN INIT INFO
# Provides: bamboo
# Required-Start: $local_fs $remote_fs $network $time
# Required-Stop: $local_fs $remote_fs $network $time
# Should-Start: $syslog
# Should-Stop: $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Atlassian Bamboo Server
### END INIT INFO
# INIT Script
######################################

# Define some variables
# Name of app ( bamboo, Confluence, etc )
APP=bamboo
# Name of the user to run as
USER=bamboo
# Location of application's bin directory
BASE=/opt/atlassian/bamboo/current

case "$1" in
# Start command
start)
echo "Starting $APP"
/bin/su - $USER -c "export BAMBOO_HOME=${BAMBOO_HOME}; $BASE/bin/startup.sh &> /dev/null"
;;
# Stop command
stop)
echo "Stopping $APP"
/bin/su - $USER -c "$BASE/bin/shutdown.sh &> /dev/null"
echo "$APP stopped successfully"
;;
# Restart command
restart)
$0 stop
sleep 5
$0 start
;;
*)
echo "Usage: /etc/init.d/$APP {start|restart|stop}"
exit 1
;;
esac
exit 0

9) Give execute permission

chmod +x /etc/init.d/bamboo

10) enable init script.

/sbin/chkconfig --add bamboo

chkconfig --list bamboo

11) Access the Bamboo server on http://localhost:8085 in your favorite browser and follow below steps to configure bamboo.



Access https://my.atlassian.com and get your evaluation licence for configuring Bamboo server.


Clicking on express installation will use default settings and will use an internal DB. For real-time projects this is not recommended. so we will configure an external DBs like PostgreSQL. so we will try custom installation now.                                                                                                                   



Select PostgreSQL for configuring Database for bamboo server.                                               



Provide DB details which we created earlier.




Configure admin account for Bamboo server.