...more or less
Why talk about deployment?
A presentation made by Kirill Kalachev / @dhampik
|-- var
|-- www
|-- facebook
|-- current => /var/www/facebook/releases/20130721000000
|-- releases
| |-- 20130721000000
| |-- 20130602000000
|-- shared
It wastes your time!!!
It wastes your time anyway!!!
Better, but you have to code all by yourself
These are actually tools for automating server configuration, but they could also be used for deployment
// config.php
'connections' => [
'staging' => [
'host' => '188.226.251.17',
'username' => 'phpist',
'password' => '',
'key' => '',
'db_role' => true,
/*...*/
],
'production' => [/*...*/]
],
// config.php
'on' => [
'connections' => [
'staging' => [
'scm' => ['branch' => 'staging'],
'remote' => [
'root_directory' => '/var/www/',
'app_directory' => 'staging.site.com'
]
],
'production' => [/*...*/]
]
]
// hooks.php
'before-symlink' => [
'deploy' => [
function ($task) {
$task->runForCurrentRelease([
$task->binary('npm')->install(),
$task->binary('bower')->install('--config.interactive=false'),
$task->binary('grunt')->build(),
]);
$task->runForCurrentRelease([
$task->binary('php')->yii('migrate --interactive=0')
]);
}
]
],
We should use real path instead of symlinked, so that php5-fpm would understand that code has changed
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
php vendor/anahkiasen/rocketeer/bin/rocketeer deploy