Skip to content
Snippets Groups Projects

Rollout plugins

8 files
+ 405
2
Compare changes
  • Side-by-side
  • Inline

Files

@@ -7,6 +7,7 @@ require_once __DIR__.'/../inc_functions.php';
require_once 'base.class.php';
require_once 'htmlguielements.class.php';
require_once 'messenger.class.php';
require_once 'rollout_base.class.php';
/* ######################################################################
@@ -81,13 +82,25 @@ class project extends base {
*/
private $_iRcAll = 0;
/**
* reference to html renderer class to draw output items
* @var object
*/
protected $_oHtml = false;
/**
* object to access a version control, .e. git
* @var type
* @var object
*/
private $_oVcs = false;
/**
* object for rollout
* @var type
*/
public $oRolloutPlugin = false;
private $_sBranchname = false;
/**
@@ -1096,6 +1109,12 @@ class project extends base {
return $sNextPhase;
}
/**
* get an array with deploy status ...
* 'inprogress'=>do versions differ from phase to phase = rollout of a version is in progress
'hasQueue'=>is there a package in a queue (waiting for deployment time to get ready to be installed)
* @return array
*/
public function getProgress(){
$this->getAllPhaseInfos();
return $this->_aData['progress'];
@@ -1310,6 +1329,23 @@ class project extends base {
return $this->_oVcs;
}
/**
* get an array of enabled plugins
* @param string $sSection one of false|"rollout"|...
* @return array
*/
public function getConfiguredPlugins($sSection=false){
$aReturn=array();
if(!$sSection){
$aReturn=$this->_aConfig["plugins"];
} else {
foreach ($this->_aConfig["plugins"]["rollout"] as $sPluginName=>$aItem) {
$aReturn[$sPluginName] = $aItem;
}
}
return $aReturn;
}
/**
* get a flat array of all existing ssh keys
* @return array
@@ -1435,6 +1471,27 @@ class project extends base {
// echo "<pre>" . print_r($aData, true) . "</pre>";
$this->_verifyConfig();
// ----- init rollout plugin
// set name of the activated plugin for this project
$sPluginName=(isset($this->_aPrjConfig['deploy']['active_rollout_plugin']) && $this->_aPrjConfig['deploy']['active_rollout_plugin'])
? $this->_aPrjConfig['deploy']['active_rollout_plugin']
: 'default'
;
$this->oRolloutPlugin = false;
try{
require_once __DIR__.'/../plugins/rollout/'.$sPluginName.'/rollout_'.$sPluginName.'.php';
$this->oRolloutPlugin = new rollout(array(
'lang'=>$this->_aConfig['lang'],
'phase'=>false,
'globalcfg'=>$this->_aConfig['plugins']['rollout'][$sPluginName],
'projectcfg'=>$this->_aPrjConfig,
));
// print_r($this->_oRolloutPlugin->getPluginfos());
// print_r($this->_oRolloutPlugin->getName());
} catch (Exception $ex) {
}
return true;
}
Loading