Setup Ubuntu server with Ruby On Rails, PostgreSQL and Redis
brew install ansible
You should have the root access to the virtual machine you want to setup. If not just login as you can and setup the root access.
ssh username@ip_address
sudo nano /root/.ssh/authorized_keys
# paste your public key
sudo nano /etc/ssh/sshd_config
# add next line to the bottom of the file without hash symbol
# PermitRootLogin yes
sudo passwd root
# create new root password
sudo systemctl restart ssh
logout
git clone git@github.com:HeadExchange/HEX-Railsbox.git
After clone you will need to checkout to puma_6 branch
cd HEX-Railsbox
git checkout puma_6
Add this gems to your Gemfile to development group.
gem "capistrano"
gem "capistrano-rbenv"
gem "capistrano-rails"
gem "capistrano-bundler"
gem "capistrano3-puma"
gem "capistrano-rake"
gem "sshkit-sudo"
You could find an example of Capfile and deploy.rb in the examples folder.
Optionnaly you may add this gems.
gem "sitemap_generator"
gem "whenever", require: false
You could also find sitemap.rb and schedule.rb file examples in the examples folder.
Get the ssh public key you use, copy and paste it to HEX-Railsbox/provision/keys folder
Change directory to provision folder and start Ansible. In code below change IP_ADDRESS to your virtual machine real IP address.
cd HEX-Railsbox/provision
ansible-playbook -iIP_ADDRESS, production.yml
If you use Capistrano, after this just change directory to your app root and call Capistrno to do the rest.
cd ../..
cap production deploy