diff --git a/composer.json b/composer.json index 4bbaa39..0ca30be 100644 --- a/composer.json +++ b/composer.json @@ -10,9 +10,8 @@ } ], "require": { - "continuousphp/sdk": "^0.8", - "symfony/console": "^3.3", - "hoa/console": "~3.0" + "continuousphp/sdk": "^0.9", + "symfony/console": "^3.3" }, "autoload": { "psr-4": { diff --git a/src/Command/CommandAbstract.php b/src/Command/CommandAbstract.php index ae0da19..b9f15ca 100644 --- a/src/Command/CommandAbstract.php +++ b/src/Command/CommandAbstract.php @@ -67,6 +67,13 @@ protected function addTokenOption() InputOption::VALUE_OPTIONAL, 'The profile of the configured credentials. See route configure', null + ) + ->addOption( + 'apiurl', + null, + InputOption::VALUE_OPTIONAL, + 'The API URL (default https://api.continuousphp.com)', + null ); } @@ -78,9 +85,9 @@ protected function execute(InputInterface $input, OutputInterface $output) { $token = $input->getOption('token'); $profile = $input->getOption('profile'); + $apiUrl = $input->getOption('apiurl') ?? null; if (null === $token && false === ($token = getenv('CPHP_TOKEN'))) { - $profile = empty($profile) ? 'default' : $profile; $token = ConfigureCommand::getToken($profile); @@ -91,7 +98,7 @@ protected function execute(InputInterface $input, OutputInterface $output) $this->continuousClient = \Continuous\Sdk\Service::factory([ 'token' => $token - ]); + ], $apiUrl); } protected function showLoader($output, $message = '', $max = 1) @@ -117,4 +124,4 @@ protected function hideLoader($output) $output->writeln("\n"); } -} \ No newline at end of file +}