Skip to content

Commit

Permalink
9.3.23
Browse files Browse the repository at this point in the history
  • Loading branch information
pookmish authored Jul 20, 2022
2 parents f3f4955 + ef6fa89 commit 1e10a3a
Show file tree
Hide file tree
Showing 64 changed files with 10,213 additions and 844 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ add_known_hosts: &add_known_hosts
## Defines images and working directory.
defaults: &defaults
docker:
- image: pookmish/drupal8ci:latest
- image: pookmish/drupal8ci:php8
- image: selenium/standalone-chrome:latest
- image: circleci/mysql:5.7
environment:
Expand Down
15 changes: 8 additions & 7 deletions .tugboat/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ services:
# What to call the service hosting the site.
suhumsci:

# Use PHP 7.2 with Apache
image: pookmish/tugboat:latest
# Use PHP 8 with Apache
image: pookmish/drupal8ci:tugboat

# Set this as the default service. This does a few things
# 1. Clones the git repository into the service container
Expand All @@ -13,7 +13,7 @@ services:
default: true

# Wait until the mysql service is done building
# depends: mysql
depends: mysql
aliases:
- hs-colorful
- hs-traditional
Expand All @@ -38,14 +38,15 @@ services:
# Copy SimpleSAMLphp configuration to prevent annoying errors.
- blt source:build:simplesamlphp-config
update:
- composer install --no-ansi
# Sync to hs_colorful and hs_colorful database & files.
- blt drupal:sync:files --site=hs_colorful
- drush @hs_colorful.local user:create tugboat --password=tugboat
- drush @hs_colorful.local user:role:add administrator tugboat
- drush @hs_colorful.local user:create tugboat --password=tugboat || true
- drush @hs_colorful.local user:role:add administrator tugboat || true

- blt drupal:sync:files --site=hs_traditional
- drush @hs_traditional.local user:create tugboat --password=tugboat
- drush @hs_traditional.local user:role:add administrator tugboat
- drush @hs_traditional.local user:create tugboat --password=tugboat || true
- drush @hs_traditional.local user:role:add administrator tugboat || true

- chown -R www-data:www-data ${TUGBOAT_ROOT}/docroot/sites/*/files
build:
Expand Down
4 changes: 4 additions & 0 deletions blt/blt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ multisites:
- datasciencemajor
- default
- dennylab
- dfetter2022
- dfetter__humsci
- dlcl
- dsresearch
Expand All @@ -105,12 +106,14 @@ multisites:
- feminist
- finance_humsci
- francestanford
- gavin_wright2022__humsci
- gavin_wright__humsci
- gender
- globalcurrents
- grandtour
- gus_humsci
- gus_humsci2021
- heidi_williams2022__humsci
- heidi_williams__humsci
- history
- hopkinsmarinestation
Expand All @@ -126,6 +129,7 @@ multisites:
- humanbiology
- humanexperience
- humanitiescore
- humanitiescore2022
- humanrights
- impact
- insidehs
Expand Down
22 changes: 9 additions & 13 deletions blt/src/Blt/Plugin/Commands/HsCircleCiCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ protected function prepEnvironment() {
*/
protected function syncAcquia($site = 'swshumsci') {
$tasks = [];
$tasks[] = $this->taskExec('mysql -u root -h 127.0.0.1 -e "create database IF NOT EXISTS drupal"');
$tasks[] = $this->taskExec('mysql -u root -h 127.0.0.1 -e "CREATE DATABASE IF NOT EXISTS drupal"');

$docroot = $this->getConfigValue('docroot');

Expand All @@ -187,18 +187,14 @@ protected function syncAcquia($site = 'swshumsci') {
}

$tasks[] = $this->taskDrush()
->alias("$site.prod")
->drush('sql-dump')
->option('result-file', "/mnt/tmp/humscigryphon/$site.sql", '=');
$tasks[] = $this->taskDrush()
->drush('rsync')
->rawArg("@$site.prod:/mnt/tmp/humscigryphon/$site.sql /tmp/$site.sql")
->option('mode', 'rultz', '=');

$tasks[] = $this->taskDrush()->drush('sql-drop')->option('yes');
$tasks[] = $this->taskDrush()
->drush('sql-cli ')
->rawArg("< /tmp/$site.sql");
->alias('')
->drush('cache-clear')->arg('drush')
->drush('sql-sync')
->arg("@$site.prod")
->arg('@self')
->option('extra-dump', '--no-tablespaces --insert-ignore', '=')
->option('structure-tables-key', 'lightweight')
->option('create-db');

$tasks[] = $this->taskExecStack()
->exec("rm -rf $docroot/sites/default/files");
Expand Down
23 changes: 9 additions & 14 deletions blt/src/Blt/Plugin/Commands/HsConfigCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,36 +32,31 @@ public function import($options = ['partial' => TRUE]) {
}

/**
* Import configuration using config_split module.
*
* @param mixed $task
* Drush task.
* @param string $cm_core_key
* Cm core key.
* {@inheritDoc}
*/
protected function importConfigSplit($task, $cm_core_key) {
$task->drush("pm-enable")->arg('config_split');
protected function importConfigSplit($task): void {
$task->drush('pm-enable')->arg('config_split');

// Local environments we don't want all the custom site created configs.
if (($this->getConfigValue('environment') == 'local') && !$this->configImportPartial) {
$task->drush("config-import")->arg($cm_core_key);
$task->drush('config-import');
// Runs a second import to ensure splits are
// both defined and imported.
$task->drush("config-import")->arg($cm_core_key);
$task->drush('config-import');
return;
}

$task->drush("config-import")->arg($cm_core_key)->option('partial');
$task->drush('config-import')->option('partial');
// Runs a second import to ensure splits are
// both defined and imported.
$task->drush("config-import")->arg($cm_core_key)->option('partial');
$task->drush('config-import')->option('partial');
}

/**
* {@inheritDoc}
*/
protected function importCoreOnly($task, $cm_core_key) {
$this->importConfigSplit($task, $cm_core_key);
protected function importCoreOnly($task): void {
$task->drush('config-import');
}

}
87 changes: 87 additions & 0 deletions blt/src/Blt/Plugin/Commands/ToggleModulesCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?php

namespace Humsci\Blt\Plugin\Commands;

use Acquia\Blt\Robo\Blt;
use Acquia\Blt\Robo\BltTasks;
use Acquia\Blt\Robo\Common\UserConfig;
use Acquia\Blt\Robo\Exceptions\BltException;
use Zumba\Amplitude\Amplitude;

/**
* Defines commands in the "drupal:toggle:modules" namespace.
*/
class ToggleModulesCommand extends BltTasks {

/**
* Enables and uninstalls specified modules.
*
* You may define the environment for which modules should be toggled by
* passing the --environment=[value] option to this command, setting the
* 'environnment' environment variable, or defining environment in one of your
* BLT configuration files.
*
* @command drupal:toggle:modules
*
* @aliases dtm toggle setup:toggle-modules
*
* @validateDrushConfig
*/
public function toggleModules() {
if ($this->getConfig()->has('environment')) {
$environment = $this->getConfigValue('environment');
}

if (isset($environment)) {
// Enable modules.
$enable_key = "modules.$environment.enable";
$this->doToggleModules('pm-enable', $enable_key);

// Uninstall modules.
$disable_key = "modules.$environment.uninstall";
$this->doToggleModules('pm-uninstall', $disable_key);
}
else {
$this->say("Environment is unset. Skipping drupal:toggle:modules...");
}
}

/**
* Enables or uninstalls an array of modules.
*
* @param string $command
* The drush command to execute, e.g., pm-enable or pm-uninstall.
* @param string $config_key
* The config key containing the array of modules.
*
* @throws \Acquia\Blt\Robo\Exceptions\BltException
*/
protected function doToggleModules($command, $config_key) {
$userConfig = new UserConfig(Blt::configDir());
$eventInfo = $userConfig->getTelemetryUserData();

if ($this->getConfig()->has($config_key)) {
$this->say("Executing <comment>drush $command</comment> for modules defined in <comment>$config_key</comment>...");
$modules = (array) $this->getConfigValue($config_key);
$modules_list = implode(' ', $modules);
$result = $this->taskDrush()
->drush("$command $modules_list")
->run();
$exit_code = $result->getExitCode();
$eventInfo['active'] = TRUE;
$eventInfo['modules'] = md5($modules_list);
Amplitude::getInstance()->queueEvent('toggle-modules', $eventInfo);
}
else {
$exit_code = 0;
$this->logger->info("$config_key is not set.");
$eventInfo['active'] = FALSE;
Amplitude::getInstance()->queueEvent('toggle-modules', $eventInfo);
}

if ($exit_code) {
throw new BltException("Could not toggle modules listed in $config_key.");
}
}

}
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,10 @@
}
],
"require": {
"acquia/blt": "^12.0",
"acquia/blt-simplesamlphp": "dev-master",
"php": ">=8.0",
"acquia/blt": "^13.4",
"acquia/blt-multisite": "^1.0",
"acquia/blt-simplesamlphp": "^1.0",
"ckeditor-plugin/liststyle": "4.14.0",
"composer/installers": "^1.9",
"cweagans/composer-patches": "^1.7",
Expand Down Expand Up @@ -256,6 +258,7 @@
"kenwheeler/slick": "^1.8",
"onlyextart/colorbox": "dev-master#e58476becbc89dc671093d1bcd9f99b2167fa8f7",
"sainsburys/guzzle-oauth2-plugin": "^3.0",
"simplesamlphp/simplesamlphp": "^1.19",
"spatie/calendar-links": "~1.5.0",
"su-sws/nobots": "^8.2",
"su-sws/react_paragraphs": "^8.2",
Expand Down Expand Up @@ -310,9 +313,6 @@
"https://www.drupal.org/project/config_ignore/issues/2857247": "https://www.drupal.org/files/issues/2020-01-11/support-for-export-2857247-44.patch",
"https://www.drupal.org/project/config_ignore/issues/2865419": "https://www.drupal.org/files/issues/2020-07-20/config_ignore-wildcard_force_import.patch"
},
"drupal/config_pages": {
"https://www.drupal.org/project/config_pages/issues/3197497": "https://www.drupal.org/files/issues/2021-02-09/issue_using_loadmultiple_to_load_all_config_page_entities-3197497-006.patch"
},
"drupal/core": {
"https://www.drupal.org/project/drupal/issues/2807629": "https://www.drupal.org/files/issues/2021-07-09/2807629-45.patch",
"https://www.drupal.org/project/drupal/issues/2999491": "https://www.drupal.org/files/issues/2020-10-06/2999491--reusable-title-display--56.patch",
Expand Down
Loading

0 comments on commit 1e10a3a

Please sign in to comment.