Skip to content
Snippets Groups Projects
Commit 2efc3c1c authored by hahn's avatar hahn
Browse files

- fixed: variables for json url

parent 569c2ce5
No related branches found
No related tags found
No related merge requests found
...@@ -289,7 +289,8 @@ class project { ...@@ -289,7 +289,8 @@ class project {
// url for deployed // url for deployed
if ($sPlace == "deployed") { if ($sPlace == "deployed") {
if ($this->isActivePhase($sPhase) && array_key_exists("url", $this->_aPrjConfig["phases"][$sPhase])) { if ($this->isActivePhase($sPhase) && array_key_exists("url", $this->_aPrjConfig["phases"][$sPhase])) {
$sBase = $this->_aPrjConfig["phases"][$sPhase]["url"] . $this->_aPrjConfig["fileprefix"]; // $sBase = $this->_aPrjConfig["phases"][$sPhase]["url"] . $this->_aPrjConfig["fileprefix"];
$sBase = $this->_aPrjConfig["phases"][$sPhase]["url"];
} else { } else {
$sBase = ''; $sBase = '';
} }
...@@ -645,19 +646,18 @@ class project { ...@@ -645,19 +646,18 @@ class project {
$sJsonfile = $this->_getInfofile($sPhase, $sKey); $sJsonfile = $this->_getInfofile($sPhase, $sKey);
$aTmp[$sKey] = array(); $aTmp[$sKey] = array();
if ($this->isActivePhase($sPhase)) { if ($this->isActivePhase($sPhase)) {
$sJsonUrl = $this->_aPrjConfig["phases"][$sPhase]["url"] . $this->_aPrjConfig["fileprefix"] . ".json"; $sJsonData = @file_get_contents($sJsonfile);
$sJsonData = @file_get_contents($sJsonUrl);
if ($sJsonData) { if ($sJsonData) {
$aJson = json_decode($sJsonData, true); $aJson = json_decode($sJsonData, true);
if (array_key_exists("version", $aJson)) { if (array_key_exists("version", $aJson)) {
$aTmp[$sKey] = $aJson; $aTmp[$sKey] = $aJson;
$aTmp[$sKey]["infofile"] = $sJsonUrl; $aTmp[$sKey]["infofile"] = $sJsonfile;
$aTmp[$sKey]["ok"] = 1; $aTmp[$sKey]["ok"] = 1;
} else { } else {
$aTmp[$sKey]["error"] = sprintf(t("class-project-error-metafile-has-no-version"), $sJsonfile, print_r($aJson, true)); $aTmp[$sKey]["error"] = sprintf(t("class-project-error-metafile-has-no-version"), $sJsonfile, print_r($aJson, true));
} }
} else { } else {
$aTmp[$sKey]["error"] = sprintf(t("class-project-error-metafile-wrong-format"), $sJsonUrl); $aTmp[$sKey]["error"] = sprintf(t("class-project-error-metafile-wrong-format"), $sJsonfile);
} }
} else { } else {
$aTmp[$sKey]["warning"] = t("class-project-warning-phase-not-active"); $aTmp[$sKey]["warning"] = t("class-project-warning-phase-not-active");
...@@ -1436,7 +1436,7 @@ class project { ...@@ -1436,7 +1436,7 @@ class project {
// $sReturn.=$this->_execAndSend("ln -s $sLinkTarget $sLinkName"); // $sReturn.=$this->_execAndSend("ln -s $sLinkTarget $sLinkName");
if (array_key_exists('mirrorPackages', $this->_aConfig) && count($this->_aConfig['mirrorPackages'])) { if (array_key_exists('mirrorPackages', $this->_aConfig) && count($this->_aConfig['mirrorPackages'])) {
foreach ($this->_aConfig['mirrorPackages'] as $sLabel => $aTarget) { foreach ($this->_aConfig['mirrorPackages'] as $sLabel => $aTarget) {
$sReturn.=sprintf(t("class-project-info-deploy-synching-package"), $sLabel) . "<br>"; $sReturn.='<h3>'.sprintf(t("class-project-info-deploy-synching-package"), $sLabel) . "</h3>";
if (array_key_exists('type', $aTarget)) { if (array_key_exists('type', $aTarget)) {
$sCmd = false; $sCmd = false;
// $sSource=$this->_aConfig["packageDir"]."/$sPhase/*"; // $sSource=$this->_aConfig["packageDir"]."/$sPhase/*";
...@@ -1473,7 +1473,7 @@ class project { ...@@ -1473,7 +1473,7 @@ class project {
// TODO: run puppet agent on target server(s) - for preview only // TODO: run puppet agent on target server(s) - for preview only
if (array_key_exists("puppethost", $this->_aPrjConfig["phases"][$sPhase]) && $this->_aPrjConfig["phases"][$sPhase]["puppethost"] if (array_key_exists("puppethost", $this->_aPrjConfig["phases"][$sPhase]) && $this->_aPrjConfig["phases"][$sPhase]["puppethost"]
) { ) {
$sReturn.=t("class-project-info-deploy-start-puppet") . "<br>"; $sReturn.='<h3>'.t("class-project-info-deploy-start-puppet") . '</h3>';
$sCmd = 'ssh ' . $this->_aConfig["installPackages"]["user"] $sCmd = 'ssh ' . $this->_aConfig["installPackages"]["user"]
. '@' . $this->_aPrjConfig["phases"][$sPhase]["puppethost"] . '@' . $this->_aPrjConfig["phases"][$sPhase]["puppethost"]
. ' ' . $this->_aConfig["installPackages"]["command"]; . ' ' . $this->_aConfig["installPackages"]["command"];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment