diff --git a/src/Cloud/Console/Command/RemoveCommand.php b/src/Cloud/Console/Command/RemoveCommand.php index 58da5a9f..bcea73ac 100644 --- a/src/Cloud/Console/Command/RemoveCommand.php +++ b/src/Cloud/Console/Command/RemoveCommand.php @@ -124,14 +124,18 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O } $context = new Satellite\Cloud\Context($client, $auth, $url); - $instance = match (true) { - \array_key_exists('pipeline', $configuration) => new Satellite\Cloud\Pipeline($context), - \array_key_exists('workflow', $configuration) => new Satellite\Cloud\Workflow($context), - default => throw new \RuntimeException('Invalid runtime satellite configuration.'), - }; - - foreach ($instance->remove($instance::fromApiWithCode($client, array_key_first($configuration['satellites']))->id()) as $command) { - $bus->push($command); + + foreach ($configuration['satellites'] as $code => $satellite) { + $satellite['code'] = $code; + $instance = match (true) { + \array_key_exists('pipeline', $satellite) => new Satellite\Cloud\Pipeline($context), + \array_key_exists('workflow', $satellite) => new Satellite\Cloud\Workflow($context), + default => throw new \RuntimeException('Invalid runtime satellite configuration.'), + }; + + foreach ($instance->remove($instance::fromApiWithCode($client, array_key_first($configuration['satellites']))->id()) as $command) { + $bus->push($command); + } } $bus->execute(); diff --git a/src/Cloud/Console/Command/UpdateCommand.php b/src/Cloud/Console/Command/UpdateCommand.php index e6128bb2..3bba6ad3 100644 --- a/src/Cloud/Console/Command/UpdateCommand.php +++ b/src/Cloud/Console/Command/UpdateCommand.php @@ -126,14 +126,18 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O } $context = new Satellite\Cloud\Context($client, $auth, $url); - $instance = match (true) { - \array_key_exists('pipeline', $configuration) => new Satellite\Cloud\Pipeline($context), - \array_key_exists('workflow', $configuration) => new Satellite\Cloud\Workflow($context), - default => throw new \RuntimeException('Invalid runtime satellite configuration.'), - }; - - foreach ($instance->update($instance::fromApiWithCode($client, array_key_first($configuration['satellites'])), $instance::fromLegacyConfiguration($configuration['satellite'])) as $command) { - $bus->push($command); + + foreach ($configuration['satellites'] as $code => $satellite) { + $satellite['code'] = $code; + $instance = match (true) { + \array_key_exists('pipeline', $satellite) => new Satellite\Cloud\Pipeline($context), + \array_key_exists('workflow', $satellite) => new Satellite\Cloud\Workflow($context), + default => throw new \RuntimeException('Invalid runtime satellite configuration.'), + }; + + foreach ($instance->update($instance::fromApiWithCode($client, array_key_first($configuration['satellites'])), $instance::fromLegacyConfiguration($configuration['satellite'])) as $command) { + $bus->push($command); + } } $bus->execute(); diff --git a/src/Console/Command/RunCommand.php b/src/Console/Command/RunCommand.php index 83b03500..d2625142 100644 --- a/src/Console/Command/RunCommand.php +++ b/src/Console/Command/RunCommand.php @@ -18,6 +18,7 @@ class RunCommand extends Console\Command\Command { protected function configure(): void { + $this->addArgument('path', Console\Input\InputArgument::REQUIRED); }