Skip to content

Commit

Permalink
updating drupal inside tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Schnitzel committed Jan 10, 2018
1 parent 7c705fe commit f51a456
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 18 deletions.
File renamed without changes.
11 changes: 3 additions & 8 deletions tests/files/drupal8/drush/drushrc.php
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
<?php
/**
* @file
* amazee.io drushrc.php file
* Lagoon drushrc.php file
*
* This file tells drush about the amazee.io environment
* It contains some defaults that the amazee.io team suggests, please edit them as required.
* This file tells drush about the Lagoon environment
* It contains some defaults that the Lagoon team suggests, please edit them as required.
*/

### Base URL so Drush knows on which URL the site runs (needed for cron, etc.)
if (getenv('AMAZEEIO_BASE_URL')) {
$options['uri'] = getenv('AMAZEEIO_BASE_URL');
}

### Skip data for some tables during sql dumps and syncs
# These tables will be syncronized just as structure and not the data inside them, this makes syncing and dumping much faster
# In case you need these tables, call the 'sql-sync' or 'sql-dump' command with: --no-structure-tables-list
Expand Down
2 changes: 1 addition & 1 deletion tests/files/drupal8/web/sites/default/all.settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
// the Drupal root, which is protected by amazee.io nginx configs, so it cannot be read
// via the browser. If your Drupal root is inside a subfolder (like 'web') you can put the config
// folder outside this subfolder for an advanced security measure: '../config/sync'.
$config_directories[CONFIG_SYNC_DIRECTORY] = 'sites/default/config/sync';
$config_directories[CONFIG_SYNC_DIRECTORY] = '../config/sync';
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
$config['system.performance']['js']['preprocess'] = 0;

// Stage file proxy URL from production URL
if(getenv('AMAZEEIO_PRODUCTION_URL')){
$config['stage_file_proxy.settings']['origin'] = getenv('PRODUCTION_URL');
if (getenv('LAGOON_PRODUCTION_URL')){
$config['stage_file_proxy.settings']['origin'] = getenv('LAGOON_PRODUCTION_URL');
}
35 changes: 28 additions & 7 deletions tests/files/drupal8/web/sites/default/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/**
* @file
* amazee.io Drupal 8 configuration file.
* Lagoon Drupal 8 configuration file.
*
* You should not edit this file, please use environment specific files!
* They are loaded in this order:
Expand All @@ -25,7 +25,7 @@
*
*/

### amazee.io Database connection
### Lagoon Database connection
if(getenv('LAGOON')){
$databases['default']['default'] = array(
'driver' => 'mysql',
Expand All @@ -38,7 +38,7 @@
);
}

### amazee.io Solr connection
### Lagoon Solr connection
// WARNING: you have to create a search_api server having "solr" machine name at
// /admin/config/search/search-api/add-server to make this work.
if (getenv('LAGOON')) {
Expand All @@ -53,16 +53,37 @@
$config['search_api.server.solr']['name'] = 'Lagoon Solr - Environment: ' . getenv('LAGOON_PROJECT');
}

### amazee.io Varnish & Reverse proxy settings
### Lagoon Redis connection
if (getenv('LAGOON')){
$settings['redis.connection']['interface'] = 'PhpRedis';
$settings['redis.connection']['host'] = getenv('REDIS_HOST') ?: 'redis';
$settings['redis.connection']['port'] = getenv('REDIS_PORT') ?: '6379';

// # Do not set the cache during installations of Drupal
// if (!drupal_installation_attempted()) {
// $settings['cache']['default'] = 'cache.backend.redis';
// }
}

### Lagoon Varnish & Reverse proxy settings
if (getenv('LAGOON')) {
$settings['reverse_proxy'] = TRUE;

$varnish_hosts = explode(',', getenv('VARNISH_HOSTS') ?: 'varnish');
array_walk($varnish_hosts, function(&$value, $key) { $value .= ':6082'; });

$config['varnish.settings']['varnish_control_terminal'] = implode($varnish_hosts, " ");
$config['varnish.settings']['varnish_control_key'] = getenv('VARNISH_SECRET') ?: 'lagoon_default_secret';
$config['varnish.settings']['varnish_version'] = 4;
}

### Trusted Host Patterns, see https://www.drupal.org/node/2410395 for more information.
### If your site runs on multiple domains, you need to add these domains here
//$settings['trusted_host_patterns'] = array(
// '^' . str_replace('.', '\.', getenv('ROUTE_URLS')) . '$',
//);
if (getenv('LAGOON_ROUTES')) {
$settings['trusted_host_patterns'] = array(
'^' . str_replace(['.', 'https://', 'http://', ','], ['\.', '', '', '|'], getenv('LAGOON_ROUTES')) . '$', // escape dots, remove schema, use commas as regex separator
);
}

### Temp directory
if (getenv('TMP')) {
Expand Down

0 comments on commit f51a456

Please sign in to comment.