Every repository with this icon (
Every repository with this icon (
DeployWithCapistrano
Capistrano is a tool for automating tasks on one or more remote servers. We use it to install and configure OneBody on fresh Ubuntu servers.
On the server:
sudo adduser deploy
visudo # add deploy to sudoers file
On the local computer:
sudo gem install capistrano
cd onebody
cp config/deploy.rb.example config/deploy.rb # edit deploy.rb appropriately and save
cap deploy:copy_ssh_key # copies your ssh public key (optional)
cap deploy:install # installs ruby, mysql, apache, passenger, etc. (Ubuntu only)
cap deploy:setup
cap deploy:cold
Now set up a virtual host in Apache pointing to /var/www/apps/onebody/current/public. Check out Passenger for more info.
If you are able to access the application but the stylesheets do not appear to be working, or you see errors in your apache error.log referencing “Invalid command ’RewriteEngine’’” you may also need to enable mod_rewrite for apache.
On the server:
sudo a2enmod rewrite
Email and Crontab
See EmailSetup and CrontabSetup for the final pieces. In short, you could do the following:
- Edit the
config/email.ymlfile at/var/www/apps/onebody/shared/configto point to your smtp and pop server(s). - Since the email config file wasn’t there when you first deployed the app, you’ll need to do another deploy:
cap deploy. Subsequent upgrades/deploys will automatically update your crontab.
Upgrades
Fist, BACKUP your database in case a migration goes berserk! No one is responsible for destroying your data except yourself. DatabaseBackups
Second, update your local copy in case the deployment recipes have changed, then:
cap deploy:cold
(The deploy:cold recipe has been reconfigured from the Capistrano default in order to upgrade Rails and install/upgrade the gem dependencies. Database migrations are also run.)






