From 4c17460165e51db9fe34c26c57f2c4508c441755 Mon Sep 17 00:00:00 2001 From: Jonathan Daggerhart Date: Fri, 17 Jun 2022 13:57:56 -0400 Subject: [PATCH] Pass db-only flag intent along to the environments() create method. --- src/Commands/BuildToolsBase.php | 5 +++-- src/Commands/EnvCreateCommand.php | 10 ++++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/Commands/BuildToolsBase.php b/src/Commands/BuildToolsBase.php index dd99a683..03dc20eb 100644 --- a/src/Commands/BuildToolsBase.php +++ b/src/Commands/BuildToolsBase.php @@ -1019,12 +1019,13 @@ function ($a, $b) { * * @param string $site_env Source site and environment. * @param string $multidev Name of environment to create. + * @param array $options Create options. */ - public function create($site_env, $multidev) + public function create($site_env, $multidev, array $options = []) { list($site, $env) = $this->getSiteEnv($site_env, 'dev'); $this->log()->notice("Creating multidev {env} for site {site}", ['site' => $site->getName(), 'env' => $multidev]); - $workflow = $site->getEnvironments()->create($multidev, $env); + $workflow = $site->getEnvironments()->create($multidev, $env, $options); while (!$workflow->checkProgress()) { // TODO: Add workflow progress output } diff --git a/src/Commands/EnvCreateCommand.php b/src/Commands/EnvCreateCommand.php index 661271b7..00d1a636 100644 --- a/src/Commands/EnvCreateCommand.php +++ b/src/Commands/EnvCreateCommand.php @@ -89,7 +89,10 @@ public function createBuildEnv( // will not be applied unless we push our change. // To allow pantheon.yml to be processed, we will // create the multidev environment, and then push the code. - $this->create($site_env_id, $multidev); + $this->create($site_env_id, $multidev, [ + 'no-db' => !$options['db-only'], + 'no-files' => $options['db-only'], + ]); $doNotify = true; } @@ -100,7 +103,10 @@ public function createBuildEnv( // If the environment is created after the branch is pushed, // then there is never a race condition -- the new env is // created with the correct files from the specified branch. - $this->create($site_env_id, $multidev); + $this->create($site_env_id, $multidev, [ + 'no-db' => !$options['db-only'], + 'no-files' => $options['db-only'], + ]); $doNotify = true; }