diff --git a/public_html/deployment/classes/html.tpl.php b/public_html/deployment/classes/html.tpl.php index d18ee910d475b7fbfa6e359428ca5bfa0eb21c93..8e511acdcc934d0e5a547ab8276e79ae8d27cc2d 100644 --- a/public_html/deployment/classes/html.tpl.php +++ b/public_html/deployment/classes/html.tpl.php @@ -29,7 +29,7 @@ } } - body{} + body{padding-top: 0;} body, label, input, button, select, textarea, p, .btn { font-size: 12px; } @@ -55,6 +55,7 @@ background: none; padding: 0.5em; margin-bottom: 2em; } + .description{font-weight:bold; color:#aaa; font-size: 200%; font-style: italic;} #content{ margin-top: 2em; border-left: 0px solid #ccc; diff --git a/public_html/deployment/classes/project.class.php b/public_html/deployment/classes/project.class.php index 7d3e6a6a617d0b96b77e4f0b34d7b92cf7133832..df565cc0f43cae376bf530487c8bac86c86a58e4 100644 --- a/public_html/deployment/classes/project.class.php +++ b/public_html/deployment/classes/project.class.php @@ -792,15 +792,21 @@ public function getBox($sWarnlevel, $sMessage){ return $sReturn; } - public function queue($sTargetphase, $sVersion) { + /** + * put a packaged version into the queue of a specified phase + * @param string $sPhase name of the phase + * @param string $sVersion version + * @return string + */ + public function queue($sPhase, $sVersion) { - if (!$this->isActivePhase($sTargetphase)) return false; + if (!$this->isActivePhase($sPhase)) return false; - $sReturn="<h2>Queue to $sTargetphase</h2>"; + $sReturn="<h2>Queue to $sPhase</h2>"; $sPlace="onhold"; $sLinkTarget = $this->_getArchiveDir($sVersion); - $sLinkName = $this->_getFileBase($sTargetphase, $sPlace); + $sLinkName = $this->_getFileBase($sPhase, $sPlace); // -------------------------------------------------- // Checks @@ -832,11 +838,17 @@ public function getBox($sWarnlevel, $sMessage){ return $this->getBox("error", 'Queuing failed One of the commands failed.' . $sReturn); } $sReturn.=$this->getBox("success", "the version $sVersion was set to place $sPlace"); - $sReturn.=$this->deploy($sTargetphase); + $sReturn.=$this->deploy($sPhase); return $sReturn; } + /** + * deploy a queued package - this moves the queue into the repo directory + * and will be installed on server within 30 min + * @param type $sTargetphase + * @return boolean|string + */ public function deploy($sTargetphase) { if (!$this->isActivePhase($sTargetphase)) return false; diff --git a/public_html/deployment/classes/projectlist.class.php b/public_html/deployment/classes/projectlist.class.php index bc43c487e3484c63dec73467a6f2ca09b8615391..14ce0617d04c479a8685263f9dfefbc7bbf9774b 100644 --- a/public_html/deployment/classes/projectlist.class.php +++ b/public_html/deployment/classes/projectlist.class.php @@ -96,16 +96,23 @@ class projectlist { public function renderOverview() { $sOut = ''; $oPrj = false; + $sTrClass="trproject"; + $sColClass="tdphase"; - $sNavi=''; - $sNavi.='<option value="trproject">Alle</option>'; + $sPrjFilter=''; + $sPhaseFilter=''; + $sPrjFilter.='<option value="'.$sTrClass.'">Alle</option>'; + $sPhaseFilter.='<option value="'.$sColClass.'">Alle</option>'; + foreach (array_keys($this->_aPhases) as $sPhase) { + $sPhaseFilter.='<option value="'.$sPhase.'">'.$sPhase.'</option>'; + } // loop over projects foreach ($this->_aProjects as $sPrj => $aData) { $oPrj = new project($sPrj); - $sNavi.='<option value="'.$sPrj.'">'.$oPrj->getLabel().'</option>'; + $sPrjFilter.='<option value="'.$sPrj.'">'.$oPrj->getLabel().'</option>'; $aPrjData = $oPrj->getAllPhaseInfos(); $sOutPhases = ''; @@ -119,7 +126,7 @@ class projectlist { if (!$oPrj->isActivePhase($sPhase)) { $sOutPhases.=' - <td class="' . $sPhase . '" colspan="3"> + <td class="' . $sPhase . ' '.$sColClass.'" colspan="3"> <div class="versioninfo center inactive"><i class="icon-ban-circle"></i> inactive</div> </td>'; } else { @@ -187,17 +194,17 @@ class projectlist { // output $sOutPhases.=' - <td class="' . $sPhase . '"> + <td class="' . $sPhase . ' '.$sColClass.'"> <div class="versioninfo"> ' . $sInfoH . ' </div> </td> - <td class="' . $sPhase . '"> + <td class="' . $sPhase . ' '.$sColClass.'"> <div class="versioninfo"> ' . $sInfoQ . ' </div> </td> - <td class="' . $sPhase . '"> + <td class="' . $sPhase . ' '.$sColClass.'"> <div class="versioninfo"> ' . $sInfoD . ' </div> @@ -209,7 +216,7 @@ class projectlist { // render output $sOut.=' - <tr class="'.$sPrj.' trproject"> + <tr class="'.$sPrj.' '.$sTrClass.'"> <td class="prj"> <a href="/deployment/'.$sPrj.'/" class="btn "><i class=" icon-book"></i> '.$oPrj->getLabel().'</a><br> ' . $oPrj->getDescription() . '<br>'; @@ -224,28 +231,34 @@ class projectlist { if ($sOut) $sOut = ' Projekt-Filter: - <select onchange="$(\'.trproject\').hide(); $(\'.\' + this.value).show();"> - '.$sNavi.' + <select onchange="$(\'.'.$sTrClass.'\').hide(); $(\'.\' + this.value).show();"> + '.$sPrjFilter.' + </select> + + Phasen: + <select onchange="$(\'.'.$sColClass.'\').hide(); $(\'.\' + this.value).show();"> + '.$sPhaseFilter.' </select> + <table class="table" id="tbloverview"> <thead> <tr> <th class="prj">Projekt</th> - <th class="preview" colspan="3" >Preview</th> - <th class="stage" colspan="3" >Stage</th> - <th class="live" colspan="3" >Live</th> + <th class="preview '.$sColClass.'" colspan="3" >Preview</th> + <th class="stage '.$sColClass.'" colspan="3" >Stage</th> + <th class="live '.$sColClass.'" colspan="3" >Live</th> </tr> <tr> <td></td> - <td class="preview">Queue</td> - <td class="preview">Repo</td> - <td class="preview">Installiert</td> - <td class="stage">Queue</td> - <td class="stage">Repo</td> - <td class="stage">Installiert</td> - <td class="live">Queue</td> - <td class="live">Repo</td> - <td class="live">Installiert</td> + <td class="preview '.$sColClass.'">Queue</td> + <td class="preview '.$sColClass.'">Repo</td> + <td class="preview '.$sColClass.'">Installiert</td> + <td class="stage '.$sColClass.'">Queue</td> + <td class="stage '.$sColClass.'">Repo</td> + <td class="stage '.$sColClass.'">Installiert</td> + <td class="live '.$sColClass.'">Queue</td> + <td class="live '.$sColClass.'">Repo</td> + <td class="live '.$sColClass.'">Installiert</td> </tr> </thead> <tbody> diff --git a/public_html/deployment/inc_functions.php b/public_html/deployment/inc_functions.php index 5ad8f0981089538741924b9edebabb0f1c58bf46..5a11aa47d6033ab2ff34d787db9e0208f52182cc 100644 --- a/public_html/deployment/inc_functions.php +++ b/public_html/deployment/inc_functions.php @@ -50,7 +50,7 @@ function getTopArea(){ require_once("./classes/project.class.php"); $oPrj=new project($aParams["prj"]); $sReturn=' '. aHome() . ' ' . aPrjHome().' - <h1>'.$oPrj->getLabel().'</h1><span>'.$oPrj->getDescription().'</div>'; + <h1>'.$oPrj->getLabel().'</h1><span class="description">'.$oPrj->getDescription().'</div>'; if (array_key_exists("action", $aParams)){ $sReturn.='<h2>Aktion: '.$aParams["action"].'</h2>'; } diff --git a/shellscripts/cron_deployment.php b/shellscripts/cron_deployment.php new file mode 100644 index 0000000000000000000000000000000000000000..64b0f957f1961d9a44a9abed012cccaea45f217c --- /dev/null +++ b/shellscripts/cron_deployment.php @@ -0,0 +1,20 @@ +<?php + + +// http://iml:deployment@ci.iml.unibe.ch/deployment/?prj=ci&action=deploy&par3=preview&confirm=1 + + require_once(dirname(__dir__) . "/public_html/deployment/config/inc_projects_config.php"); + + $sAuth="iml:deployment@"; + + echo "===== IMLDEPLOYMENT - deploy all projects =====\n"; + foreach ($aProjects as $sPrj=>$aData){ + echo "--- $sPrj\n"; + foreach (array_keys($aConfig["phases"]) as $sPhase){ + echo "$sPhase ... "; + $sUrl="http://${sAuth}ci.iml.unibe.ch/deployment/?prj=${sPrj}&action=deploy&par3=${sPhase}&confirm=1"; + echo file_get_contents($sUrl); + } + echo "\n"; + } + echo "done\n"; \ No newline at end of file