From 34b689067439c80c06276acc668654067c4a6183 Mon Sep 17 00:00:00 2001 From: Gregor Harlan Date: Wed, 6 Apr 2022 13:52:19 +0200 Subject: [PATCH] fix for new rc of deployer v7 --- bin/dep | 7 +++++++ composer.json | 4 +++- recipe/base.php | 16 +++++++++------- recipe/symfony.php | 2 +- 4 files changed, 20 insertions(+), 9 deletions(-) create mode 100755 bin/dep 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', [