diff --git a/config/inc_projects_config.php b/config/inc_projects_config.php index e64b1e729104dd5ca2d3934b18707919de40e508..86722e70ec9fa51097bb9ce5dbd48338daa09036 100644 --- a/config/inc_projects_config.php +++ b/config/inc_projects_config.php @@ -7,6 +7,7 @@ $aConfig = array( // Basispfad: 'workDir' => '/var/imldeployment', + 'tmpDir' => '/var/tmp/imldeployment', 'versionsToKeep' => 10, // for cleanup: keep n unused versions 'builtsToKeep' => 3, // for cleanup: keep n failed builds 'hooks' => array( @@ -89,6 +90,9 @@ switch (php_uname("n")) { break; } +if (!array_key_exists('tmpDir', $aConfig) || !$aConfig["tmpDir"]){ + $aConfig["tmpDir"] = (getenv("temp") ? getenv("temp") : "/var/tmp") . '/imldeployment'; +} // ---------------------------------------------------------------------- // TODO: include custom settings that were saved in the GUI // ---------------------------------------------------------------------- diff --git a/public_html/deployment/classes/project.class.php b/public_html/deployment/classes/project.class.php index fa2675c8bcf069e2cdbd66f40b160ba34c06817f..ca330dd584acc03d5381f99c380528b7b1053324 100644 --- a/public_html/deployment/classes/project.class.php +++ b/public_html/deployment/classes/project.class.php @@ -1,4 +1,5 @@ <?php +require_once 'base.class.php'; /* ###################################################################### @@ -15,7 +16,8 @@ /** * class for single project */ -class project { +// class project { +class project extends base{ // ---------------------------------------------------------------------- // CONFIG // ---------------------------------------------------------------------- @@ -726,7 +728,7 @@ class project { $sJsonData = $this->_httpGet($sJsonfile); if ($sJsonData) { $aJson = json_decode($sJsonData, true); - if (array_key_exists("version", $aJson)) { + if (is_array($aJson) && array_key_exists("version", $aJson)) { $aTmp[$sKey] = $aJson; $aTmp[$sKey]["infofile"] = $sJsonfile; $aTmp[$sKey]["ok"] = 1; @@ -1021,6 +1023,7 @@ class project { // for vcs classes $aConfig["appRootDir"] = $this->_aConfig["appRootDir"]; $aConfig["dataDir"] = $this->_aConfig["dataDir"]; + $aConfig["tmpDir"] = $this->_aConfig["tmpDir"]; $this->_oVcs = new vcs($aConfig); if ($this->_sBranchname) { if (method_exists($this->_oVcs, "setCurrentBranch")) { @@ -1173,10 +1176,10 @@ class project { public function getBox($sWarnlevel, $sMessage) { $this->log(__FUNCTION__ . " start"); $aCfg = array( - "error" => array("class" => "alert alert-error", "prefix" => t("error")), + "error" => array("class" => "alert alert-danger", "prefix" => t("error")), "success" => array("class" => "alert alert-success", "prefix" => t("success")), "info" => array("class" => "alert alert-info", "prefix" => t("info")), - "warning" => array("class" => "alert alert-block", "prefix" => t("warning")), + "warning" => array("class" => "alert alert-warning", "prefix" => t("warning")), ); $sClass = ""; $sPrefix = ""; @@ -2031,6 +2034,7 @@ class project { 'build' => array('icon' => 'glyphicon glyphicon-equalizer', 'class' => $sFirst, 'hint' => sprintf(t("build-hint"), $sFirst), 'label' => t('build'), + 'role' => 'buildProject' ), 'cleanup' => array('icon' => 'glyphicon glyphicon-chevron-right', 'class' => ''), 'deploy' => array('icon' => 'glyphicon glyphicon-forward', 'class' => $sPhase, @@ -2058,7 +2062,16 @@ class project { 'label' => t('setup') ), ); - // fuer wen ist der Link: + // TODO: remove $sRole and use user roles + /* + $sNeedsRole = ( + array_key_exists($sFunction, $aLinkdata) && array_key_exists('role', $aLinkdata[$sFunction]) + ) ? $aLinkdata[$sFunction]['role'] : ''; + if (!$this->oUser->hasRole($sNeedsRole)){ + return false; + } + */ + // fuer wen ist der Link $sRole = ''; $sOnMouseover=''; if ($sFunction == "build") { diff --git a/public_html/deployment/classes/vcs.git.class.php b/public_html/deployment/classes/vcs.git.class.php index 3605abbe5322d6ef7291f27494138e8b0c3ff81c..6ebef5979b44346caf16ee345028805eb1aff4f7 100644 --- a/public_html/deployment/classes/vcs.git.class.php +++ b/public_html/deployment/classes/vcs.git.class.php @@ -104,7 +104,7 @@ class vcs implements iVcs { private function _setTempdir() { $this->_sTempDir = $this->_aCfg["url"]; $this->_sTempDir = preg_replace('/[\@\.\:\/]/', '_', $this->_sTempDir); - $this->_sTempDir = (getenv("temp") ? getenv("temp") : "/var/tmp") . '/checkout_vcsgit_' . $this->_sTempDir . '/'; + $this->_sTempDir = $this->_aCfg["tmpDir"] . '/checkout_vcsgit_' . $this->_sTempDir . '/'; $this->_sTempDir .= preg_replace('/[\@\.\:\/]/', '_', $this->_sCurrentBranch) . '/'; if (!file_exists($this->_sTempDir . ".git") || true) {