- Create
deployer
user on webserver:- home:
/home/deployer
- home:
- Set up rbenv for deployer user
sudo apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev libpq-dev
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
rbenv rehash
mkdir -p "$(rbenv root)/plugins"
git clone https://github.com/rbenv/ruby-build.git $(rbenv root)/plugins/ruby-build
git clone https://github.com/rbenv/rbenv-vars.git $(rbenv root)/plugins/rbenv-vars
git clone https://github.com/tpope/rbenv-aliases.git "$(rbenv root)/plugins/rbenv-aliases"
rbenv alias --auto
rbenv install 2.6.0
- Configure
/home/deployer/website/shared/config/database.yml
and/home/deployer/website/shared/.rbenv-vars
as needed - Set up your local copy of the website
git clone https://github.com/snoonetIRC/website.git
- Follow all steps for setting up rbenv
cd website
rbenv local 2.6.0
gem install bundler
rbenv exec bundler install --with=development
rbenv exec cap production deploy
- Configure nginx as needed
Assuming you already have a local dev environment configured, just cd <dev env>
, git pull
, rbenv exec cap production deploy
Might have to rbenv exec bundler install
first in case dependencies updated