diff --git a/bin/dep b/bin/dep new file mode 100755 index 0000000..3a3d9a6 --- /dev/null +++ b/bin/dep @@ -0,0 +1,7 @@ +#!/usr/bin/env php +set('deploy_path', DEPLOYER_ROOT.'/.build') - ->set('release_path', DEPLOYER_ROOT.'/.build/release') + ->set('deploy_path', $baseDir.'/.build') + ->set('release_path', $baseDir.'/.build/release') ->set('current_path', '{{release_path}}') ; @@ -65,14 +67,14 @@ 'deploy:publish', ]); -task('build:setup', function () { +task('build:setup', function () use ($baseDir) { if ('local' !== Context::get()->getHost()->getAlias()) { throw new \RuntimeException('Task "build" can only be called on host "local"'); } if (getenv('CI')) { - set('deploy_path', DEPLOYER_ROOT); - set('release_path', DEPLOYER_ROOT); + set('deploy_path', $baseDir); + set('release_path', $baseDir); return; } @@ -111,8 +113,8 @@ } }); -task('upload', function () { - $source = getenv('CI') ? DEPLOYER_ROOT : host('local')->get('release_path'); +task('upload', function () use ($baseDir) { + $source = getenv('CI') ? $baseDir : host('local')->get('release_path'); upload($source.'/', '{{release_path}}', [ 'flags' => '-az', diff --git a/recipe/symfony.php b/recipe/symfony.php index 1f48a8b..09cb409 100644 --- a/recipe/symfony.php +++ b/recipe/symfony.php @@ -4,7 +4,7 @@ namespace Deployer; -require dirname(DEPLOYER_BIN, 2).'/recipe/symfony.php'; +require 'phar://'.DEPLOYER_BIN.'/recipe/symfony.php'; require __DIR__.'/base.php'; set('copy_dirs', [