From d5a31b1d7149de65edbafb496bf4c9599c3c8a82 Mon Sep 17 00:00:00 2001 From: hahn <axel.hahn@iml.unibe.ch> Date: Wed, 30 Oct 2019 18:11:13 +0100 Subject: [PATCH] fetch last output on build failures --- .../deployment/classes/project.class.php | 32 ++++++++++++------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/public_html/deployment/classes/project.class.php b/public_html/deployment/classes/project.class.php index 64ff53c6..cf92a8a4 100644 --- a/public_html/deployment/classes/project.class.php +++ b/public_html/deployment/classes/project.class.php @@ -1621,10 +1621,11 @@ class project extends base { $sReturn.=$this->_execAndSend("ls -lisa $sTempBuildDir"); if (!$this->_iRcAll == 0) { - $this->_TempDelete($sTempBuildDir); - $sError = sprintf(t('class-project-error-command-failed'), $sTempBuildDir) . $sReturn; + $sError = sprintf(t('class-project-error-command-failed'), $sTempBuildDir); $this->_logaction($sError, __FUNCTION__, "error"); - return $this->_oHtml->getBox("error", $sError); + $this->_TempFill($sError.$sReturn, $aActionList); + $this->_TempDelete($sTempBuildDir); + return $this->_oHtml->getBox("error", $sError.$sReturn); } // -------------------------------------------------- @@ -1661,6 +1662,7 @@ class project extends base { if (!$this->_iRcAll == 0) { $sError = sprintf(t('class-project-error-command-failed'), $sTempBuildDir); $this->_logaction($sError, __FUNCTION__, "error"); + $this->_TempFill($sError.$sReturn, $aActionList); $this->_TempDelete($sTempBuildDir); return $this->_oHtml->getBox("error", $sError . $sReturn); } @@ -1695,10 +1697,11 @@ class project extends base { // $this->_iRcAll = 0; $sReturn.=$this->_execAndSend('bash --login -c \'' . $sSetEnv.' '.$sTempBuildDir . '/' . $sHookfile . '\''); if (!$this->_iRcAll == 0) { - $this->_TempDelete($sTempBuildDir); - $sError = sprintf(t('class-project-error-command-failed'), $sTempBuildDir) . $sReturn; + $sError = sprintf(t('class-project-error-command-failed'), $sTempBuildDir); $this->_logaction($sError, __FUNCTION__, "error"); - return $this->_oHtml->getBox("error", $sError); + $this->_TempFill($sError.$sReturn, $aActionList); + $this->_TempDelete($sTempBuildDir); + return $this->_oHtml->getBox("error", $sError . $sReturn); } } else { $sReturn.=t('skip') . '<br>'; @@ -1740,17 +1743,19 @@ class project extends base { } if (!$sWebroot) { - $this->_TempDelete($sTempBuildDir); $sError = t('class-project-error-build-docroot-not-found'); $this->_logaction($sError, __FUNCTION__, "error"); + $this->_TempFill($sError.$sReturn, $aActionList); + $this->_TempDelete($sTempBuildDir); return $this->_oHtml->getBox("error", $sError . $sReturn . $sError); } } if (!$this->_iRcAll == 0) { - $this->_TempDelete($sTempBuildDir); - $sError = sprintf(t('class-project-error-command-failed'), $sTempBuildDir) . $sReturn; + $sError = sprintf(t('class-project-error-command-failed'), $sTempBuildDir); $this->_logaction($sError, __FUNCTION__, "error"); - return $this->_oHtml->getBox("error", $sError); + $this->_TempFill($sError.$sReturn, $aActionList); + $this->_TempDelete($sTempBuildDir); + return $this->_oHtml->getBox("error", $sError . $sReturn); } // $sReturn.=$this->_oHtml->getBox("success", "preparations ok - directory is ready for packaging now."); // generate info file @@ -1795,9 +1800,11 @@ class project extends base { } $sReturn.=$this->_execAndSend("ls -ld " . dirname($sPackageFileArchiv)); if (!file_exists(dirname($sPackageFileArchiv))) { - $this->_TempDelete($sTempBuildDir); + $sError = sprintf(t('"class-project-error-build-dir-was-not-created"'), $sTempBuildDir); $this->_logaction($sError, __FUNCTION__, "error"); + $this->_TempFill($sError.$sReturn, $aActionList); + $this->_TempDelete($sTempBuildDir); return $this->_oHtml->getBox("error", $sError . $sReturn); } $this->_TempFill($sReturn, $aActionList); @@ -1828,9 +1835,10 @@ class project extends base { // TEST // $this->_iRcAll=1; if (!$this->_iRcAll == 0) { - $this->_TempDelete($sTempBuildDir); $sError = t('class-project-error-build-packaging-failed'); $this->_logaction($sError, __FUNCTION__, "error"); + $this->_TempFill($sError.$sReturn, $aActionList); + $this->_TempDelete($sTempBuildDir); return $this->_oHtml->getBox("error", $sError . $sReturn); } $aActionList['iActive'] ++; -- GitLab