If you have followed the Ruby deployment tutorial, then you know that deploying application updates takes multiple steps.Performing all these steps every time you want to deploy application updates is time-consuming and error-prone.But the thing about database migrations is that it should only be run from one server.If you have scaled your app across 5 servers, then you will want some way to tell Capistrano "run database migrations only on server #1".Here is a concrete example of how roles are useful.As I mentioned earlier, the recipe automatically runs database migrations.Once Capistrano is set up, deploying further application updates only takes a single command.Notes: Capistrano runs locally – on your computer – and logs in to one or more remote servers via SSH to execute commands.
Oak Run Florida is located on Ocala's southwest corridor just off Highway 200.
For simple apps, no additional commands need to be executed, but for more complex apps this flexibility is welcome.
This works by defining tasks that hook into the various steps that the What is this "role" thing and why does it exist?
To solve this problem, you define all 5 servers in production.rb, but only designate the "db" role to server #1.
only executes database migrations on servers with the "db" role, and since there is only one, everything goes well. Comment out the code that uses the extended server syntax: You are now done configuring Capistrano.
But before Capistrano can do its work, you need to setup a basic directory structure on the server(s), create initial configuration files and configure Passenger.