New configuration usage. Changes on Releases Listing.

This commit is contained in:
Andrs Montaez
2012-01-01 15:46:05 -02:00
parent dd46e4d637
commit 2e35bfe129
9 changed files with 124 additions and 96 deletions
+54
View File
@@ -3,6 +3,8 @@ class Mage_Config
{
private $_environment = null;
private $_scm = null;
private $_host = null;
private $_releaseId = null;
public function loadEnvironment($environment)
{
@@ -40,6 +42,28 @@ class Mage_Config
return $hosts;
}
public function setHost($host)
{
$this->_host = $host;
return $this;
}
public function getHost()
{
return $this->_host;
}
public function setReleaseId($id)
{
$this->_releaseId = $id;
return $this;
}
public function getReleaseId()
{
return $this->_releaseId;
}
public function getTasks($stage = 'on-deploy')
{
switch ($stage) {
@@ -87,4 +111,34 @@ class Mage_Config
return $taskConfig;
}
public function deployment($option, $default = false)
{
$options = $this->getEnvironment();
if (isset($options['deployment'][$option])) {
return $options['deployment'][$option];
} else {
return $default;
}
}
public function release($option, $default = false)
{
$options = $this->getEnvironment();
if (isset($options['releases'][$option])) {
return $options['releases'][$option];
} else {
return $default;
}
}
public function scm($option, $default = false)
{
$options = $this->_scm;
if (isset($options[$option])) {
return $options[$option];
} else {
return $default;
}
}
}