Skip to content

Commit

Permalink
updating robofile
Browse files Browse the repository at this point in the history
  • Loading branch information
stovak committed Jan 28, 2025
1 parent 299a117 commit 9d48096
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions RoboFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
use Symfony\Component\Process\Process;
use Symfony\Component\Yaml\Yaml;

define('STATUS_JQ_FILTER', 'jq -r \'.pantheon_search.status\'');


/**
* RoboFile is the main entry point for Robo commands.
*/
Expand Down Expand Up @@ -516,13 +519,16 @@ public function testSolrEnabled( string $site_name, string $env = 'dev' ) {
// Check that Solr8 is enabled.
$this->output()->write('Checking for Solr8 search API server...', true);
exec(
"terminus remote:drush $site_name.$env -- search-api-server-list | grep pantheon_solr8",
"terminus remote:drush $site_name.$env -- search-api-server-list --format=json | " . STATUS_JQ_FILTER ,
$server_list
);

if ( stripos( $server_list[0], 'enabled' ) === false ) {
if empty($server_list) {
\Kint::dump( $server_list );
throw new \Exception( 'No Servers Available. The default server was not imported when the module was enabled.' );
}
if ( stripos( $server_list, 'enabled' ) === false ) {
\Kint::dump( $server_list );
throw new \Exception( 'An error occurred checking that Solr8 was enable.d' );
throw new \Exception( 'An error occurred checking that Solr8 was enabled: ' . print_r($server_list, true) );
}
}

Expand Down

0 comments on commit 9d48096

Please sign in to comment.