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

Merge branch 'task-1726-gitssh-extensions' into 'master'

Task 1726 gitssh extensions

See merge request !73
parents 4c1ccd4c cae3a1ea
Branches
No related tags found
No related merge requests found
......@@ -12,12 +12,18 @@
$sOK='<span class="ok">' . t('ok') . '</span>';
$sFAILED='<span class="error">' . t('error') . '</span>';
$aErrors=array();
global $sOK;
global $sFAILED;
global $aErrors;
// test only
// $aConfig['mirrorPackages']=array('puppet' => array('target' => 'ladmin@calcium.iml.unibe.ch:/share/imldeployment'),);
// ----------------------------------------------------------------------
// functions
// ----------------------------------------------------------------------
/**
* exec a command and show OK or FAILED
*
......@@ -27,17 +33,22 @@ global $sFAILED;
* @return string
*/
function myExec($sCmd){
global $sOK, $sFAILED;
global $sOK, $sFAILED, $aErrors;
$sReturn='';
exec($sCmd . " 2>&1 && echo '$sOK' || echo '$sFAILED' ", $aOut);
$sReturn .= "<pre><strong>\$ $sCmd</strong><br>"
. implode('<br>', $aOut)."<br>"
. "</pre>";
if (strpos($sReturn, $sFAILED)){
$aErrors[]=$sCmd;
}
return $sReturn;
}
// ----------------------------------------------------------------------
// main
// ----------------------------------------------------------------------
$sOut = '<h2>SSH</h2>';
......@@ -62,9 +73,13 @@ foreach ($oPrj1->getProjects() as $sPrj) {
. '<ul>';
// test repository
$sOut .= '<li>'.t('repositoryinfos').' <strong>' . $aPrjConfig['build']['url'] . '</strong> - '
. ($oPrj->getRepoRevision() ? $sOK : $sFAILED)
;
$sOut .= '<li>'.t('repositoryinfos').' <strong>' . $aPrjConfig['build']['url'] . '</strong> - ';
if($oPrj->getRepoRevision()){
$sOut .= $sOK;
} else {
$sOut .= $sFAILED;
$aErrors[] = $aPrjConfig['build']['url'];
}
// loop over phases ...
foreach (array_keys($oPrj->getPhases()) as $sPhase) {
......@@ -80,4 +95,8 @@ foreach ($oPrj1->getProjects() as $sPrj) {
}
$sOut.='</ul>';
}
if(count($aErrors)){
echo $oHtml->getBox('error', '<ol><li>'.implode('<li>', $aErrors), '</ol>');
}
echo $sOut;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment