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

Added rollbar configuration #635

Merged
merged 6 commits into from
Mar 14, 2024
Merged
Changes from 1 commit
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
11 changes: 7 additions & 4 deletions web/sites/default/settings.pantheon.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@
if (file_exists($local_settings)) {
include $local_settings;
}

$pantheon_env = getenv('PANTHEON_ENVIRONMENT');
$pantheon_site_name = getenv('PANTHEON_SITE_NAME');
$base_private_dir = '../config/elasticsearch';
$settings['site_id'] = 'drupal_starter';
if (file_exists($base_private_dir . '/' . $settings['site_id'] . '.es.secrets.json')) {
$es_credentials = json_decode(file_get_contents($base_private_dir . '/' . $settings['site_id'] . '.es.secrets.json'), TRUE);
if (is_array($es_credentials)) {
$fallback = 'dev';
$pantheon_env = getenv('PANTHEON_ENVIRONMENT');
$env = str_replace('-', '_', !empty($pantheon_env) ? $pantheon_env : $fallback);

if (!isset($es_credentials[$env])) {
Expand All @@ -70,9 +70,12 @@
}
}
}

$pantheon_env = getenv('PANTHEON_ENVIRONMENT');
if (!empty($pantheon_env)) {
// Rollbar settings for LIVE and TEST.
if ($pantheon_env == 'live' || $pantheon_env == 'test') {
$config['rollbar.environment'] = $pantheon_site_name . '.' . $pantheon_env;
$config['rollbar.enabled'] = TRUE;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here we would also have the access token of rollbar right? If so, let's add a placeholder

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. Access token is saved in the module's config file, but there is a setting which disables the module, here we just enable it.

}
switch ($pantheon_env) {
case 'test':
$config['environment_indicator.indicator']['bg_color'] = '#ffcc6b';
Expand Down