3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Deployerでローカルへのデプロイを行う方法

Posted at

ローカルレシピ(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');
3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?