-
-
Save 78lab/90f6c053dcddc551d22e to your computer and use it in GitHub Desktop.
title: ncloud 우분투(ubuntu 12.04 LTS) nginx passenger rails4 capistrano3 setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "* Updating system" | |
apt-get update | |
apt-get -y upgrade | |
echo "* Installing packages" | |
apt-get -y install build-essential libmagickcore-dev imagemagick libmagickwand-dev libxml2-dev libxslt1-dev git-core nginx redis-server curl nodejs htop | |
apt-get -y install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libgdbm-dev libncurses5-dev automake libtool bison libffi-dev imagemagick | |
id -u deploy &> /dev/null | |
if [ $? -ne 0 ] | |
then | |
echo "* Creating user deploy" | |
adduser deploy | |
echo "* Adding user deploy to sudo group" | |
adduser deploy sudo | |
else | |
echo "* deploy user already exists" | |
fi | |
echo "* Installing rvm" | |
. /etc/profile.d/rvm.sh &> /dev/null | |
type rvm &> /dev/null | |
if [ $? -ne 0 ] | |
then | |
curl -L https://get.rvm.io | bash -s | |
echo "source /etc/profile.d/rvm.sh" >> /etc/bash.bashrc | |
. /etc/profile.d/rvm.sh &> /dev/null | |
else | |
echo "* rvm already installed" | |
fi | |
cat /etc/environment | grep RAILS_ENV | |
if [ $? -ne 0 ] | |
then | |
echo "RAILS_ENV=production" >> /etc/environment | |
fi | |
echo "* Adding a gemrc file to deploy user" | |
echo -e "verbose: true\nbulk_threshold: 1000\ninstall: --no-ri --no-rdoc --env-shebang\nupdate: --no-ri --no-rdoc --env-shebang" > /home/deploy/.gemrc | |
chmod 644 /home/deploy/.gemrc | |
chown deploy /home/deploy/.gemrc | |
chgrp deploy /home/deploy/.gemrc | |
echo "* Install ruby version 2.0.0" | |
ruby -v &> /dev/null | |
if [ $? -ne 0 ] | |
then | |
rvm install 2.1.3 | |
else | |
echo "* Ruby already installed" | |
fi | |
echo "* Add user deploy to rvm group" | |
usermod -a -G rvm deploy | |
rvm --default use 2.1.3 | |
ruby -v | |
echo "* DONE *" | |
echo "* Rebooting system *" | |
reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment