diff --git a/public_html/deployment/classes/project.class.php b/public_html/deployment/classes/project.class.php index 0b032dda0acf9b0f3e1cf905cd9385e2a6f6d4c0..082abffd902481a28c4023fc47521aa706c5408a 100644 --- a/public_html/deployment/classes/project.class.php +++ b/public_html/deployment/classes/project.class.php @@ -1604,12 +1604,21 @@ class project extends base { // -------------------------------------------------- // execute hook postclone // -------------------------------------------------- + // task#1726 - add environment + $sSetEnv='' + . 'export GIT_SSH="'.$this->_aConfig['appRootDir'].'shellscripts/gitsshwrapper.sh";' + . 'export DIR_SSH_KEYS="'.$this->_aConfig['dataDir'].'/sshkeys";' + . 'export DIR_APPROOT="'.$sTempDir.'";' + ; + $sHookfile = $this->_aConfig['hooks']['build-postclone']; - $sReturn.='<h3>' . t('class-project-build-label-execute-hook-postclone') . ' (' . $sHookfile . ')</h3>'; + $sReturn.='<h3>' . t('class-project-build-label-execute-hook-postclone') . ' (' . $sHookfile . ')</h3>' + . 'env: <pre>'.$sSetEnv.'</pre>'; + if (file_exists($sTempDir . '/' . $sHookfile)) { // $sReturn.=$this->_execAndSend('chmod 755 ' . $sTempDir . '/hooks/on*'); // $this->_iRcAll = 0; - $sReturn.=$this->_execAndSend('bash --login -c \'' . $sTempDir . '/' . $sHookfile . '\''); + $sReturn.=$this->_execAndSend('bash --login -c \'' . $sSetEnv.' '.$sTempDir . '/' . $sHookfile . '\''); if (!$this->_iRcAll == 0) { $sError = sprintf(t('class-project-error-command-failed'), $sTempDir); $this->_logaction($sError, __FUNCTION__, "error"); @@ -1645,7 +1654,7 @@ class project extends base { if (file_exists($sTempDir . '/' . $sHookfile)) { // $sReturn.=$this->_execAndSend('chmod 755 ' . $sTempDir . '/hooks/on*'); // $this->_iRcAll = 0; - $sReturn.=$this->_execAndSend('bash --login -c \'' . $sTempDir . '/' . $sHookfile . '\''); + $sReturn.=$this->_execAndSend('bash --login -c \'' . $sSetEnv.' '.$sTempDir . '/' . $sHookfile . '\''); if (!$this->_iRcAll == 0) { $this->_TempDelete(); $sError = sprintf(t('class-project-error-command-failed'), $sTempDir) . $sReturn;