diff --git a/CHANGELOG.md b/CHANGELOG.md index 963c13cbc..573d18e0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ - Fixed check_remote task revision resolution [#1994] - Fixed backward compatibility of bin/console for symfony4 recipe - Keep consistency with executable naming in lock recipe +- Unexpected exception in config:* tasks when no stage is defined for host [#1909] [#1909] [#1909] ## v6.7.3 @@ -566,6 +567,7 @@ [#1989]: https://github.com/deployphp/deployer/issues/1989 [#1971]: https://github.com/deployphp/deployer/pull/1971 [#1969]: https://github.com/deployphp/deployer/issues/1969 +[#1909]: https://github.com/deployphp/deployer/issues/1909 [#1899]: https://github.com/deployphp/deployer/pull/1899 [#1893]: https://github.com/deployphp/deployer/pull/1893 [#1881]: https://github.com/deployphp/deployer/pull/1881 diff --git a/recipe/config/current.php b/recipe/config/current.php index f1cee55f4..816b4b17a 100644 --- a/recipe/config/current.php +++ b/recipe/config/current.php @@ -16,7 +16,7 @@ $selectedStage = Deployer::get()->getInput()->getArgument('stage'); on(Deployer::get()->hosts, function (Host $host) use (&$rows, $selectedStage) { - if ($host->get('stage') !== $selectedStage) { + if ($selectedStage && $host->get('stage', false) !== $selectedStage) { return; } diff --git a/recipe/config/hosts.php b/recipe/config/hosts.php index 9830f2c8f..f6981bc1b 100644 --- a/recipe/config/hosts.php +++ b/recipe/config/hosts.php @@ -15,7 +15,7 @@ $selectedStage = Deployer::get()->getInput()->getArgument('stage'); foreach (Deployer::get()->hosts as $host) { - if ($host->get('stage') !== $selectedStage) { + if ($selectedStage && $host->get('stage', false) !== $selectedStage) { continue; }