-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#1236] Moved provider settings in their own files.
- Loading branch information
1 parent
6cc5650
commit 752d009
Showing
11 changed files
with
117 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Acquia hosting provider settings. | ||
* | ||
* @see https://docs.acquia.com/acquia-cloud/develop/env-variable | ||
*/ | ||
|
||
if (!empty(getenv('AH_SITE_ENVIRONMENT'))) { | ||
// Delay the initial database connection. | ||
$config['acquia_hosting_settings_autoconnect'] = FALSE; | ||
|
||
// Include Acquia environment settings. | ||
if (file_exists('/var/www/site-php/your_site/your_site-settings.inc')) { | ||
// @codeCoverageIgnoreStart | ||
require '/var/www/site-php/your_site/your_site-settings.inc'; | ||
$settings['config_sync_directory'] = $settings['config_vcs_directory']; | ||
// @codeCoverageIgnoreEnd | ||
} | ||
|
||
// Default all environments to 'dev', including ODE environments. | ||
$settings['environment'] = ENVIRONMENT_DEV; | ||
|
||
// Do not put any Acquia-specific settings in this code block. It is used | ||
// to explicitly map Acquia environments to $settings['environment'] | ||
// variable only. | ||
// Instead, use 'PER-ENVIRONMENT SETTINGS' section below. | ||
switch (getenv('AH_SITE_ENVIRONMENT')) { | ||
case 'prod': | ||
$settings['environment'] = ENVIRONMENT_PROD; | ||
break; | ||
|
||
case 'test': | ||
$settings['environment'] = ENVIRONMENT_TEST; | ||
break; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
/** | ||
* @file | ||
* Lagoon hosting provider settings. | ||
*/ | ||
|
||
if (getenv('LAGOON') && getenv('LAGOON_ENVIRONMENT_TYPE') == 'production' || getenv('LAGOON_ENVIRONMENT_TYPE') == 'development') { | ||
// Do not put any Lagoon-specific settings in this code block. It is used | ||
// to explicitly map Lagoon environments to $settings['environment'] | ||
// variable only. | ||
// Instead, use 'PER-ENVIRONMENT SETTINGS' section below. | ||
// | ||
// Environment is marked as 'production' in Lagoon. | ||
if (getenv('LAGOON_ENVIRONMENT_TYPE') == 'production') { | ||
$settings['environment'] = ENVIRONMENT_PROD; | ||
} | ||
// All other environments running in Lagoon are considered 'development'. | ||
else { | ||
// Any other environment is considered 'development' in Lagoon. | ||
$settings['environment'] = ENVIRONMENT_DEV; | ||
|
||
// But try to identify production environment using a branch name for | ||
// the cases when 'production' Lagoon environment is not provisioned yet. | ||
if (!empty(getenv('LAGOON_GIT_BRANCH')) && !empty(getenv('DREVOPS_LAGOON_PRODUCTION_BRANCH')) && getenv('LAGOON_GIT_BRANCH') === getenv('DREVOPS_LAGOON_PRODUCTION_BRANCH')) { | ||
$settings['environment'] = ENVIRONMENT_PROD; | ||
} | ||
// Dedicated test environment based on a branch name. | ||
elseif (getenv('LAGOON_GIT_BRANCH') == 'master') { | ||
$settings['environment'] = ENVIRONMENT_TEST; | ||
} | ||
// Test environment based on a branch prefix for release and | ||
// hotfix branches. | ||
elseif (!empty(getenv('LAGOON_GIT_BRANCH')) && (str_starts_with(getenv('LAGOON_GIT_BRANCH'), 'release/') || str_starts_with(getenv('LAGOON_GIT_BRANCH'), 'hotfix/'))) { | ||
$settings['environment'] = ENVIRONMENT_TEST; | ||
} | ||
} | ||
|
||
// Lagoon version. | ||
if (!defined('LAGOON_VERSION')) { | ||
define('LAGOON_VERSION', '1'); | ||
} | ||
|
||
// Lagoon reverse proxy settings. | ||
$settings['reverse_proxy'] = TRUE; | ||
// Reverse proxy settings. | ||
$settings['reverse_proxy_header'] = 'HTTP_TRUE_CLIENT_IP'; | ||
|
||
// Cache prefix. | ||
$settings['cache_prefix']['default'] = (getenv('LAGOON_PROJECT') ?: getenv('DREVOPS_PROJECT')) . '_' . (getenv('LAGOON_GIT_SAFE_BRANCH') ?: getenv('DREVOPS_LAGOON_PRODUCTION_BRANCH')); | ||
|
||
// Trusted host patterns for Lagoon internal routes. | ||
// URL when accessed from PHP processes in Lagoon. | ||
$settings['trusted_host_patterns'][] = '^nginx\-php$'; | ||
// Lagoon URL. | ||
$settings['trusted_host_patterns'][] = '^.+\.au\.amazee\.io$'; | ||
// Lagoon routes. | ||
if (getenv('LAGOON_ROUTES')) { | ||
$patterns = str_replace(['.', 'https://', 'http://', ','], [ | ||
'\.', '', '', '|', | ||
], getenv('LAGOON_ROUTES')); | ||
$settings['trusted_host_patterns'][] = '^' . $patterns . '$'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
752d009
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀 Deployed on https://661e55a40a1d370fbb67173b--drevops-scaffold-docs.netlify.app