ローカルレシピ(Local recipe)
ローカルのデプロイパスを指定これだけでOK。
これをつかうとreleaseを世代管理してアップデートできる。
env('local_deploy_path', '/tmp/deployer');
逆にこちらのローカルリリースパスを使うと、世代管理なしにフォルダにアプリを展開して終わるので、再度デプロイを実行したときにエラーになった。
env('local_release_path', '/tmp/my_application');
例:composerで必要なライブラリはインストール済み
# deploy.php
require 'vendor/autoload.php';
require 'recipe/common.php';
require 'vendor/deployphp/recipes/recipes/local.php';
set('repository', 'git@github.com:org/app.git');
# env('local_release_path', './test');
env('local_deploy_path', '/root/app/test');
/**
* Main task
* local:を付けないとリモートへのデプロイ用の
* サーバー設定が必要になる
*/
task('deploy', [
'local:prepare',
'local:release',
'local:update_code',
#'local:vendors',
'local:symlink',
'local:cleanup'
]);
//展開後必要な処理などを
task('do_after', function(){
writeln('<comment>shell start</comment>');
run('sh do_after.sh');
writeln('<comment>shell end</comment>');
});
after('local:cleanup', 'do_after');