Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Economics sandbox #1663

Draft
wants to merge 5 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 9 additions & 30 deletions .tugboat/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ services:
aliases:
- hs-colorful
- hs-traditional
- english
- history
- west
- economics

# A set of commands to run while building this service
commands:
Expand Down Expand Up @@ -53,14 +51,8 @@ services:
- blt drupal:sync:files --site=hs_traditional
- drush @hs_traditional.local user:create tugboat --password=pushcar || true
- drush @hs_traditional.local user:role:add administrator tugboat || true

# Sync to english, history, and west database & files, does not create a user.
- blt drupal:sync:files --site=english

- blt drupal:sync:files --site=history

- blt drupal:sync:files --site=west

- blt drupal:sync:files --site=economics

- chown -R www-data:www-data ${TUGBOAT_ROOT}/docroot/sites/*/files
build:
Expand All @@ -76,17 +68,9 @@ services:
- drush @hs_traditional.local eval '\Drupal::moduleHandler()->loadInclude("user", "install");user_update_10000();'
- blt drupal:update --site=hs_traditional

- drush @english.local cr
- drush @english.local eval '\Drupal::moduleHandler()->loadInclude("user", "install");user_update_10000();'
- blt drupal:update --site=english

- drush @history.local cr
- drush @history.local eval '\Drupal::moduleHandler()->loadInclude("user", "install");user_update_10000();'
- blt drupal:update --site=history

- drush @west.local cr
- drush @west.local eval '\Drupal::moduleHandler()->loadInclude("user", "install");user_update_10000();'
- blt drupal:update --site=west
- drush @economics.local cr
- drush @economics.local eval '\Drupal::moduleHandler()->loadInclude("user", "install");user_update_10000();'
- blt drupal:update --site=economics

- npm run theme-build

Expand All @@ -109,26 +93,21 @@ services:
# Delete and recreate the database for each site.
- mysql -e "DROP DATABASE IF EXISTS hs_colorful; CREATE DATABASE hs_colorful;"
- mysql -e "DROP DATABASE IF EXISTS hs_traditional; CREATE DATABASE hs_traditional;"
- mysql -e "DROP DATABASE IF EXISTS english; CREATE DATABASE english;"
- mysql -e "DROP DATABASE IF EXISTS history; CREATE DATABASE history;"
- mysql -e "DROP DATABASE IF EXISTS west; CREATE DATABASE west;"
- mysql -e "DROP DATABASE IF EXISTS economics; CREATE DATABASE economics;"

# Give the tugboat user access to the new databases.
- mysql -e "GRANT ALL PRIVILEGES ON *.* TO 'tugboat'; FLUSH PRIVILEGES;"

# Download each database dump.
- scp humscigryphon.prod@web-42199.prod.hosting.acquia.com:/mnt/gfs/humscigryphon.prod/backups/prod-hs_colorful-humscigrydb423120-`date -d '8 hours ago' +%Y-%m-%d`.sql.gz /tmp/hs_colorful.sql.gz
- scp humscigryphon.prod@web-42199.prod.hosting.acquia.com:/mnt/gfs/humscigryphon.prod/backups/prod-hs_traditional-humscigrydb423132-`date -d '8 hours ago' +%Y-%m-%d`.sql.gz /tmp/hs_traditional.sql.gz
- scp humscigryphon.prod@web-42199.prod.hosting.acquia.com:/mnt/gfs/humscigryphon.prod/backups/prod-english-humscigrydb423084-`date -d '8 hours ago' +%Y-%m-%d`.sql.gz /tmp/english.sql.gz
- scp humscigryphon.prod@web-42199.prod.hosting.acquia.com:/mnt/gfs/humscigryphon.prod/backups/prod-history-humscigrydb423116-`date -d '8 hours ago' +%Y-%m-%d`.sql.gz /tmp/history.sql.gz
- scp humscigryphon.prod@web-42199.prod.hosting.acquia.com:/mnt/gfs/humscigryphon.prod/backups/prod-west-humscigrydb423301-`date -d '8 hours ago' +%Y-%m-%d`.sql.gz /tmp/west.sql.gz
- scp humscigryphon.prod@web-42199.prod.hosting.acquia.com:/mnt/gfs/humscigryphon.prod/backups/prod-economics-humscigrydb423080-`date -d '8 hours ago' +%Y-%m-%d`.sql.gz /tmp/economics.sql.gz

# Import each database dump into the associated table.
- zcat /tmp/hs_colorful.sql.gz | mysql hs_colorful
- zcat /tmp/hs_traditional.sql.gz | mysql hs_traditional
- zcat /tmp/english.sql.gz | mysql english
- zcat /tmp/history.sql.gz | mysql history
- zcat /tmp/west.sql.gz | mysql west
- zcat /tmp/economics.sql.gz | mysql economics


# Clean up after ourselves to keep the Preview size small.
- rm /tmp/*.sql.gz
155 changes: 155 additions & 0 deletions docroot/sites/economics/settings/ci.settings.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,155 @@
<?php

use Acquia\Blt\Robo\Common\EnvironmentDetector;
assert_options(ASSERT_EXCEPTION, TRUE);
if (getenv('TUGBOAT_SERVICE')) {
/**
* Database configuration.
*/
$databases = [
'default' =>
[
'default' =>
[
'database' => 'economics',
'username' => 'tugboat',
'password' => 'tugboat',
'host' => 'mysql',
'port' => '3306',
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
'driver' => 'mysql',
'prefix' => '',
],
],
];
}


// Use development service parameters.
$settings['container_yamls'][] = EnvironmentDetector::getRepoRoot() . '/docroot/sites/development.services.yml';
$settings['container_yamls'][] = EnvironmentDetector::getRepoRoot() . '/docroot/sites/blt.development.services.yml';

// Allow access to update.php.
$settings['update_free_access'] = TRUE;

/**
* Assertions.
*
* The Drupal project primarily uses runtime assertions to enforce the
* expectations of the API by failing when incorrect calls are made by code
* under development.
*
* @see http://php.net/assert
* @see https://www.drupal.org/node/2492225
*
* If you are using PHP 7.0 it is strongly recommended that you set
* zend.assertions=1 in the PHP.ini file (It cannot be changed from .htaccess
* or runtime) on development machines and to 0 in production.
*
* @see https://wiki.php.net/rfc/expectations
*/
assert_options(ASSERT_ACTIVE, TRUE);
assert_options(ASSERT_EXCEPTION, TRUE);

/**
* Show all error messages, with backtrace information.
*
* In case the error level could not be fetched from the database, as for
* example the database connection failed, we rely only on this value.
*/
$config['system.logging']['error_level'] = 'verbose';

/**
* Disable CSS and JS aggregation.
*/
$config['system.performance']['css']['preprocess'] = FALSE;
$config['system.performance']['js']['preprocess'] = FALSE;

/**
* Disable the render cache (this includes the page cache).
*
* Note: you should test with the render cache enabled, to ensure the correct
* cacheability metadata is present. However, in the early stages of
* development, you may want to disable it.
*
* This setting disables the render cache by using the Null cache back-end
* defined by the development.services.yml file above.
*
* Do not use this setting until after the site is installed.
*/
// $settings['cache']['bins']['render'] = 'cache.backend.null';
/**
* Disable Dynamic Page Cache.
*
* Note: you should test with Dynamic Page Cache enabled, to ensure the correct
* cacheability metadata is present (and hence the expected behavior). However,
* in the early stages of development, you may want to disable it.
*/
// $settings['cache']['bins']['dynamic_page_cache'] = 'cache.backend.null';
/**
* Allow test modules and themes to be installed.
*
* Drupal ignores test modules and themes by default for performance reasons.
* During development it can be useful to install test extensions for debugging
* purposes.
*/
$settings['extension_discovery_scan_tests'] = FALSE;


/**
* Configure static caches.
*
* Note: you should test with the config, bootstrap, and discovery caches
* enabled to test that metadata is cached as expected. However, in the early
* stages of development, you may want to disable them. Overrides to these bins
* must be explicitly set for each bin to change the default configuration
* provided by Drupal core in core.services.yml.
* See https://www.drupal.org/node/2754947
*/

// $settings['cache']['bins']['bootstrap'] = 'cache.backend.null';
// $settings['cache']['bins']['discovery'] = 'cache.backend.null';
// $settings['cache']['bins']['config'] = 'cache.backend.null';
/**
* Enable access to rebuild.php.
*
* This setting can be enabled to allow Drupal's php and database cached
* storage to be cleared via the rebuild.php page. Access to this page can also
* be gained by generating a query string from rebuild_token_calculator.sh and
* using these parameters in a request to rebuild.php.
*/
$settings['rebuild_access'] = FALSE;

/**
* Skip file system permissions hardening.
*
* The system module will periodically check the permissions of your site's
* site directory to ensure that it is not writable by the website user. For
* sites that are managed with a version control system, this can cause problems
* when files in that directory such as settings.php are updated, because the
* user pulling in the changes won't have permissions to modify files in the
* directory.
*/
$settings['skip_permissions_hardening'] = TRUE;

/**
* Files paths.
*/
$settings['file_private_path'] = EnvironmentDetector::getRepoRoot() . '/files-private/default';
/**
* Site path.
*
* @var $site_path
* This is always set and exposed by the Drupal Kernel.
*/
// phpcs:ignore
$settings['file_public_path'] = 'sites/' . EnvironmentDetector::getSiteName($site_path) . '/files';

/**
* Trusted host configuration.
*
* See full description in default.settings.php.
*/
$settings['trusted_host_patterns'] = [
'^.+$',
];
Loading