SAAS-560: Deploy separate cloud storage config files for each development environment

Default to production config files if dev env specific files are not
found.
Fix analyzer unit tests.
This commit is contained in:
drigato 2015-02-05 14:31:20 -05:00
parent e2ff452b8a
commit cee0ff4881
4 changed files with 20 additions and 4 deletions

View file

@ -43,6 +43,11 @@ class Config {
// Parse separate conf file for cloud storage values
$cloudStorageConfig = "/etc/airtime-saas/".$CC_CONFIG['dev_env']."/cloud_storage.conf";
if (!file_exists($cloudStorageConfig)) {
// If the dev env specific cloud_storage.conf doesn't exist default
// to the production cloud_storage.conf
$cloudStorageConfig = "/etc/airtime-saas/production/cloud_storage.conf";
}
$cloudStorageValues = parse_ini_file($cloudStorageConfig, true);
$CC_CONFIG["supportedStorageBackends"] = array('amazon_S3');

View file

@ -89,7 +89,13 @@ class Application_Model_RabbitMq
if (array_key_exists("dev_env", $CC_CONFIG)) {
$devEnv = $CC_CONFIG["dev_env"];
}
$config = parse_ini_file("/etc/airtime-saas/".$devEnv."/rabbitmq-analyzer.ini", true);
$rmq_config_path = "/etc/airtime-saas/".$devEnv."/rabbitmq-analyzer.ini";
if (!file_exists($rmq_config_path)) {
// If the dev env specific rabbitmq-analyzer.ini doesn't exist default
// to the production rabbitmq-analyzer.ini
$rmq_config_path = "/etc/airtime-saas/production/rabbitmq-analyzer.ini";
}
$config = parse_ini_file($rmq_config_path, true);
$conn = new AMQPConnection($config["rabbitmq"]["host"],
$config["rabbitmq"]["port"],
$config["rabbitmq"]["user"],