This assumes the deployment user is rapidftr. You must fill in
sudo apt-get update
sudo apt-get install ruby1.9.1 ruby1.9.1-dev rubygems1.9.1 irb1.9.1
ri1.9.1 rdoc1.9.1 \
build-essential libopenssl-ruby1.9.1 libssl-dev zlib1g-dev git
default-jdk nginx-core libcurl4-openssl-dev
gem install bundler
gem install passenger
sudo apt-get install -y couchdb
sudo service couchdb restart
sudo passenger-install-nginx-module
sudo mkdir /srv/rapid_ftr_production
sudo chown rapidftr:rapidftr /srv/rapid_ftr_production
sudo mkdir /etc/nginx
sudo chown rapidftr:rapidftr /etc/nginx
sudo mkdir /etc/nginx/conf
sudo chown rapidftr:rapidftr /etc/nginx/conf
sudo mkdir /etc/nginx/ssl
sudo chown rapidftr:rapidftr /etc/nginx/ssl
# Adapted from https://gist.github.com/dwayne/2983873
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
echo 'export NODE_PATH=$HOME/local/lib/node_modules' >> ~/.bashrc
. ~/.bashrc
mkdir -p ~/local
mkdir -p ~/Downloads/node-latest-install
cd ~/Downloads/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local # if SSL support is not required, use --without-ssl
make install # this step takes a while
sudo reboot
cd /tmp
git clone https://github.com/rapidftr/RapidFTR.git
cd RapidFTR
git checkout v1.1.0
bundle install
bundle exec cap deploy -S branch=release-1.1.0 -S deploy_server=<ip_address> -S deploy_user=rapidftr -S http_port=80 -S https_port=443 -S solr_port=8983 -S nginx_site_conf=/etc/nginx/conf -S couchdb_username=rapidftr -S couchdb_password=rapidftr -S server_name=localhost
sudo pkill nginx
sudo pkill Passenger
sudo cp /etc/nginx/conf/production_80.conf /etc/nginx/sites-enabled/
sudo rm /etc/nginx/conf/default
sudo nginx -c /etc/nginx/nginx.conf