SAAS-560: Deploy separate cloud storage config files for each development environment
This commit is contained in:
parent
93da48351c
commit
5040eb498d
3 changed files with 22 additions and 16 deletions
|
@ -25,19 +25,6 @@ class Config {
|
|||
$filename = isset($_SERVER['AIRTIME_CONF']) ? $_SERVER['AIRTIME_CONF'] : "/etc/airtime/airtime.conf";
|
||||
}
|
||||
|
||||
// Parse separate conf file for cloud storage values
|
||||
$cloudStorageConfig = isset($_SERVER['CLOUD_STORAGE_CONF']) ? $_SERVER['CLOUD_STORAGE_CONF'] : "/etc/airtime-saas/cloud_storage.conf";
|
||||
$cloudStorageValues = parse_ini_file($cloudStorageConfig, true);
|
||||
|
||||
$CC_CONFIG["supportedStorageBackends"] = array('amazon_S3');
|
||||
foreach ($CC_CONFIG["supportedStorageBackends"] as $backend) {
|
||||
$CC_CONFIG[$backend] = $cloudStorageValues[$backend];
|
||||
}
|
||||
|
||||
// Tells us where file uploads will be uploaded to.
|
||||
// It will either be set to a cloud storage backend or local file storage.
|
||||
$CC_CONFIG["current_backend"] = $cloudStorageValues["current_backend"]["storage_backend"];
|
||||
|
||||
$values = parse_ini_file($filename, true);
|
||||
|
||||
// Name of the web server user
|
||||
|
@ -54,6 +41,19 @@ class Config {
|
|||
$CC_CONFIG['dev_env'] = 'production';
|
||||
}
|
||||
|
||||
// Parse separate conf file for cloud storage values
|
||||
$cloudStorageConfig = "/etc/airtime-saas/".$CC_CONFIG['dev_env']."/cloud_storage_".$CC_CONFIG['dev_env'].".conf";
|
||||
$cloudStorageValues = parse_ini_file($cloudStorageConfig, true);
|
||||
|
||||
$CC_CONFIG["supportedStorageBackends"] = array('amazon_S3');
|
||||
foreach ($CC_CONFIG["supportedStorageBackends"] as $backend) {
|
||||
$CC_CONFIG[$backend] = $cloudStorageValues[$backend];
|
||||
}
|
||||
|
||||
// Tells us where file uploads will be uploaded to.
|
||||
// It will either be set to a cloud storage backend or local file storage.
|
||||
$CC_CONFIG["current_backend"] = $cloudStorageValues["current_backend"]["storage_backend"];
|
||||
|
||||
$CC_CONFIG['cache_ahead_hours'] = $values['general']['cache_ahead_hours'];
|
||||
|
||||
$CC_CONFIG['monit_user'] = $values['monit']['monit_user'];
|
||||
|
|
|
@ -89,7 +89,7 @@ class Application_Model_RabbitMq
|
|||
if (array_key_exists("dev_env", $CC_CONFIG)) {
|
||||
$devEnv = $CC_CONFIG["dev_env"];
|
||||
}
|
||||
$config = parse_ini_file("/etc/airtime-saas/rabbitmq-analyzer-" . $devEnv . ".ini", true);
|
||||
$config = parse_ini_file("/etc/airtime-saas/".$devEnv."/rabbitmq-analyzer-" . $devEnv . ".ini", true);
|
||||
$conn = new AMQPConnection($config["rabbitmq"]["host"],
|
||||
$config["rabbitmq"]["port"],
|
||||
$config["rabbitmq"]["user"],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue