### This is an RFC for a deployment shell command
Example config (config/deployment_config.php):
{{{
class DeploymentConfig {
var $source = array(
'type' => 'git',
'host' => 'git@thechaw.com:cakephp.git'
);
var $servers = array(
'dev' => array(
'type' => 'web',
'environment' => 'dev',
'host' => 'dev.mysite.com',
'login' => 'nate',
'password' => 'foo',
'path' => '/usr/local/web/htdocs/my_site'
),
'stage' => array(
'type' => 'web',
'environment' => 'staging',
'host' => 'dev.mysite.com',
'login' => 'nate',
'password' => 'foo',
'path' => '/usr/local/web/htdocs/my_site'
),
'web1' => array(
'type' => 'web',
'environment' => 'production',
'host' => 'www.mysite.com',
'login' => 'nate',
'password' => 'foo',
'path' => '/usr/local/web/htdocs/my_site'
),
'web2' => array(
'type' => 'web',
'environment' => 'production',
'host' => 'www2.mysite.com',
'login' => 'nate',
'password' => 'foo',
'path' => '/usr/local/web/htdocs/my_site'
),
'db1' => array(
'type' => 'database',
'environment' => 'production',
'tunnel' => 'internal',
'host' => '192.168.1.122', /* IP behind firewall, accessed via SSH */
'login' => 'nate',
'password' => null, /* Super-sensitive, prompt for password */
)
'db2' => array(
'type' => 'database',
'environment' => array('dev', 'staging'),
'tunnel' => 'internal',
'host' => '192.168.1.123', /* IP behind firewall, accessed via SSH */
'login' => 'nate',
'password' => null, /* Super-sensitive, prompt for password */
)
);
var $tunnels = array(
'internal' => array(
'type' => 'ssh',
'host' => '70.86.113.130',
'login' => 'nate',
'password' => null
)
);
}
}}}
### Basic tasks:
1. Check to see if current (local) schema version is consistent with development db
1. Pull the latest working copy of the code to the server, alongside current code
1. Put the site in "maintenance mode" by pointing all traffic to a static page
1. Sync the remote database with the latest committed schema
1. Clear remote caches
1. Put the new codebase in maintenance mode
1. Swap the old and new code by renaming folders appropriately
1. Possibly run a test group or two
1. Flip the newly-minted code back out of maintenance mode
1. Profit
