Skip to content

Commit

Permalink
9.4.4
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish authored Jan 24, 2023
2 parents 7971c3d + 8a4730a commit 34a4a27
Show file tree
Hide file tree
Showing 15 changed files with 342 additions and 197 deletions.
26 changes: 24 additions & 2 deletions blt/src/Blt/Plugin/Commands/HsCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
namespace Humsci\Blt\Plugin\Commands;

use Acquia\Blt\Robo\BltTasks;
use Acquia\Blt\Robo\Common\EnvironmentDetector;
use Acquia\Blt\Robo\Exceptions\BltException;
use Drupal\Core\Serialization\Yaml;
use GuzzleHttp\Client;
use Robo\Exception\TaskException;

/**
Expand Down Expand Up @@ -92,18 +94,38 @@ public function disableModules($modules, $environment, $excluded_sites = '') {
public function cron() {
// Disable alias since we are targeting specific uri.
$this->config->set('drush.alias', '');

$failed = [];
foreach ($this->getConfigValue('multisites') as $multisite) {
try {
$this->say("Running Cron on <comment>$multisite</comment>...");
$this->switchSiteContext($multisite);

$this->taskDrush()
$task = $this->taskDrush()
->drush("cron")
->run();
if (!$task->wasSuccessful()) {
$failed[] = $multisite;
}
}
catch (\Exception $e) {
$this->say("Unable to run cron on <comment>$multisite</comment>");
continue;
}
}

if ($failed) {
$secrets = EnvironmentDetector::getAhFilesRoot() . '/secrets.settings.php';
if (file_exists($secrets)) {
include $secrets;

$client = new Client();
$payload = [
'username' => 'Acquia Cloud',
'icon' => ':information_source:',
'text' => 'Cron failed on at least one site: ' . implode(', ', $failed),
];
$encoded = json_encode($payload, JSON_UNESCAPED_UNICODE);
$client->post(getenv('SLACK_NOTIFICATION_URL'), ['body' => $encoded]);
}
}
}
Expand Down
6 changes: 4 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,9 @@
"drupal/menu_trail_by_path": {
"https://www.drupal.org/project/menu_trail_by_path/issues/2914746": "https://www.drupal.org/files/issues/2022-04-06/2914746-27.patch"
},
"drupal/migrate_plus": {
"https://www.drupal.org/project/migrate_plus/issues/2837684": "https://www.drupal.org/files/issues/2023-01-13/2837684-14-migrate-plus-xml-return-as-xml.patch"
},
"drupal/paragraphs": {
"https://www.drupal.org/project/paragraphs/issues/2895561": "https://www.drupal.org/files/issues/2021-05-06/paragraphs-2895561-32.patch"
},
Expand All @@ -358,8 +361,7 @@
"https://www.drupal.org/project/simplesamlphp_auth/issues/2936889": "https://www.drupal.org/files/issues/2020-07-31/simplesamlphp_auth-avoid_unexpected_redirect-2936889-12-d8.patch"
},
"drupal/ui_patterns": {
"Ui Patterns Views Preview": "patches/contrib/ui_patterns_views-preview.patch",
"https://www.drupal.org/project/ui_patterns/issues/3311471": "patches/contrib/ui_patterns-detect_libraries.patch"
"Ui Patterns Views Preview": "patches/contrib/ui_patterns_views-preview.patch"
},
"drupal/video_embed_field": {
"https://www.drupal.org/project/video_embed_field/issues/2913925": "https://www.drupal.org/files/issues/2018-07-09/retrieve-title-2913925-5.patch"
Expand Down
Loading

0 comments on commit 34a4a27

Please sign in to comment.