Tuesday, April 8, 2014

Install Teamcity 8.1 on Ubuntu 12.04

Download teamcity

wget -c http://www.jetbrains.com/teamcity/download/ 
Create dedicated team city user:
adduser --system --shell /bin/bash --gecos 'TeamCity Build Control' --group --disabled-password --home /opt/teamcity teamcity

Install Java

apt-get -y install software-properties-common
apt-add-repository ppa:webupd8team/java
apt-get -y update
echo debconf shared/accepted-oracle-license-v1-1 select true | debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | debconf-set-selections
DEBIAN_FRONTEND=noninteractive apt-get -y install oracle-java7-installer

Install mysql

apt-get install mysql-server

Create database & user

mysql>create user tcclient;
mysql>create database teamcity default charset utf8;
mysql>create user tcclient;
mysql>grant all privileges on teamcity.* to tcclient@localhost identified by 'secure_password';
Download MySQL JDBC driver from oracle site and copy it to /opt/teamcity/data/.BuildServer/lib/jdbc
Create Teamcity server start script in init.d
vim /etc/init.d/teamcity-server
#!/bin/bash
# /etc/init.d/teamcity - startup script for teamcity
export TEAMCITY_DATA_PATH="/opt/teamcity/data/.BuildServer"

case $1 in
start)
start-stop-daemon --start -c teamcity --exec /opt/teamcity/TeamCity/bin/teamcity-server.sh start
;;

stop)
start-stop-daemon --stop -c teamcity --exec /opt/teamcity/TeamCity/bin/teamcity-server.sh stop
;;

esac

exit 0
Make sure all the team city files and directory are owned by team city user
cd /opt
chown -R teamcity.teamcity teamcity
Download MySQL JDBC driver from oracle site and copy it to /opt/teamcity/data/.BuildServer/lib/jdbc
Open the Teamcity URL in the browser:
http://teamcity:8111/mnt

Nginx Proxy for Teamcity

apt-get install nginx
Create a file team city under#
cd /etc/nginx/sites-available/

vim teamcity

server {
 listen 80;
 server_name teamcity;

 location / {
            proxy_pass http://localhost:8111;
    }
}
Check for the syntax
nginx -t -c /etc/nginx/sites-available/default

ln -s /etc/nginx/sites-available/teamcity teamcity

service nginx restart
Now you can access the machine as
http://teamcity/

Monday, April 7, 2014

JIRA upgrade from Ver. 5.2 to 6.2

JIRA upgrade from Ver. 5.2 to 6.2

Steps:
Take jira backup in xml format- Login to JIRA with admin privileges and export the backup
  • Copy data folder from JIRA - Attachments /Gravatar/logos
  • Copy plugins
  • Stop JIRA - /etc/init.d/JIRA stop
  • Download the latest jira .bin from Atlassian JIRA download page.
chmod a+x atlassian-jira-X.Y.bin
mkdir -p /opt/atlassian/jira/
  • Execute the '.bin' file to start the upgrade wizard.
  • choose #2
/opt/atlassian/jira/

Install data directory

/opt/jira6/
  • Create mysql database:
mysql> CREATE DATABASE jiradb6 CHARACTER SET utf8 COLLATE utf8_bin;
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,INDEX on jiradb6.* TO 'jirauser'@'localhost' IDENTIFIED BY 'jira_secure_passwd';Query OK, 0 rows affected (0.05 sec)
mysql> flush privileges;
  • Download mysql-connector from oracle website and copy it to the JIRA/lib directory.
scp mysql-connector-java-5.1.30-bin.jar /opt/atlassian/jira/lib/
  • During the https:// browse give the absolute location of DB xml locaiton : the setup wizard will import all the db.
  • Copy the attachments,gravatar & logos from old installation to the new. i.e #scp -r attachments/ /opt/jira6/data/
  • Make sure all the permission give to jira user and jira group if you are installing on the same machine then the new user will be jira1 instead of jira
Check the logs. ie. tail -f /opt/atlassian/jira/logs/catalina.2014-04-01.log