Skip to content
Snippets Groups Projects
Commit fcdae77b authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

rollout plugins: handle name and id

parent a23aa337
No related branches found
No related tags found
1 merge request!72OP#7651 CI Server: beide AWX ansteuerbar machen https://projects.iml.unibe.ch/work_packages/7651
......@@ -17,6 +17,13 @@ class rollout_base implements iRolloutplugin
// ---------------------------------------------------------------
// VARIABLES
// ---------------------------------------------------------------
/**
* Plugin name
* @var string
*/
protected string $_sPluginName = 'UNSET';
/**
* identifier for current plugin; it us used to find the current plugin
* settings in the config structore for global and project based config
......@@ -82,6 +89,7 @@ class rollout_base implements iRolloutplugin
* Constructor
* initialize rollout plugin
* @param array $aParams hash with those possible keys
* id string rollout plugin id in project config
* lang string language, i.e. 'de'
* phase string name of phase in a project
* globalcfg array given global config $aConfig
......@@ -94,7 +102,8 @@ class rollout_base implements iRolloutplugin
// set current plugin id - taken from plugin directory name above
$oReflection = new ReflectionClass($this);
$this->_sPluginId = basename(dirname($oReflection->getFileName()));
$this->_sPluginName = basename(dirname($oReflection->getFileName()));
$this->_sPluginId = $aParams['id'] ?? 'UNSET';
// ----- init language
if (isset($aParams['lang'])) {
......@@ -244,7 +253,7 @@ class rollout_base implements iRolloutplugin
(isset($aVarinfos['ttl']) ? $aVarinfos['ttl'] : 60)
);
if (!$aCallbackData) {
$aVarinfos['type'] = 'text';
$aVarinfos['type'] = $aVarinfos['type'] ?? 'text';
} else {
$aEffectiveConfig = $this->getConfig($sPhase);
// echo $sKey.' ... '; print_r($aEffectiveConfig[$sVarname]); echo '<br>';
......@@ -524,7 +533,7 @@ class rollout_base implements iRolloutplugin
public function getDeployCommands(string $sPhase, bool $bMask = false): array
{
return [
'echo "ERROR: The method getDeployCommamds($sPhase) was not implemented in the rollout plugin [' . $this->getId() . ']"',
'echo "ERROR: The method getDeployCommamds($sPhase) was not implemented in the rollout plugin [' . $this->_sPluginName . ']"',
'exit 1'
];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment