Skip to content
Snippets Groups Projects
Commit 9b75a0fb authored by hahn's avatar hahn
Browse files

- Fix: Deploy Button wird wieder angezeigt

- neu: Deploy Zeitpunkt kann übergangen werden
- config umgestell: rsync der Pakete nur für ci.iml.unibe.ch
parent a6c565ca
No related branches found
No related tags found
No related merge requests found
<?php
/* ######################################################################
IML DEPLOYMENT
......@@ -25,7 +26,11 @@ if (array_key_exists("par3", $aParams)){
if (array_key_exists("confirm", $aParams)) {
$sOut.=$oPrj->deploy($sPhase);
$bIgnoreDeploytimes = false;
if (array_key_exists("bIgnoreDeploytimes", $aParams)) {
$bIgnoreDeploytimes = $aParams["bIgnoreDeploytimes"];
}
$sOut.=$oPrj->deploy($sPhase, $bIgnoreDeploytimes);
} else {
if ($sPhase) {
$sPhase = $aParams["par3"];
......@@ -44,6 +49,12 @@ if (array_key_exists("confirm", $aParams)) {
<form action="?" method="post" enctype="multipart/form-data">
<input type="hidden" name="confirm" value="1">
<fieldset>
<strong>Nur für für Notfälle:</strong><br>
<input type="checkbox" name="bIgnoreDeploytimes" value="1"> Deploy-Zeitfenster ignorieren.<br>
Nicht jedes Update muss sauber durchlaufen. Nur aktivieren, wenn
einer der Entwickler und/ oder ein Sysadmin zur Hand ist.<br>
</fieldset><br>
<fieldset>
<button type="submit" class="btn btn-primary btn-large" >Deploy</button>
</fieldset>
......
......@@ -1034,9 +1034,10 @@ class project {
* and will be installed on server within 30 min.
* This method checks the deploy times
* @param string $sPhase which queue of which phase we want to install in server
* @param bool $bIgnoreDeploytimes flag; if true it will override time windows
* @return boolean|string
*/
public function deploy($sPhase) {
public function deploy($sPhase, $bIgnoreDeploytimes=false) {
$sReturn = "<h2>Deploy " . $this->getLabel() . " to $sPhase</h2>";
if (!$this->isActivePhase($sPhase)) {
......@@ -1063,10 +1064,15 @@ class project {
$sReturn.="<br>";
}
if (!$bCanDeploy) {
if (!$bIgnoreDeploytimes) {
$sReturn.=$this->getBox("info", "SKIP: Im Moment ist leider kein Deployment-Zeitfenster");
return $sReturn;
}else {
$sReturn.="Im Moment ist leider kein Deployment-Zeitfenster - aber das wird ignoriert.<br>";
}
} else {
$sReturn.="OK, wir sind im erforderlichen Zeitfenster.<br>";
}
$sReturn.="OK, deployment time was reached.<br>";
// if ()
}
if (!file_exists($sQueueLink)) {
......@@ -1459,10 +1465,12 @@ class project {
switch ($sPlace) {
case "onhold":
if (array_key_exists($sPhase, $this->_aConfig)) {
$sReturn .= print_r($this->_aConfig[$sPhase], true);
if (array_key_exists("deploytimes", $this->_aConfig[$sPhase])) {
$sReturn .= '<br><i class="icon-time"></i> Deployment:<br>' . implode("<br>", array_values($this->_aPhases[$sPhase]["deploytimes"]));
if (array_key_exists("phases", $this->_aConfig) && array_key_exists($sPhase, $this->_aConfig["phases"])) {
// $sReturn .= print_r($this->_aConfig["phases"][$sPhase], true);
if (array_key_exists("deploytimes", $this->_aConfig["phases"][$sPhase])) {
$sReturn .= '<br><i class="icon-time"></i> Deployment:<br>'
. implode("<br>", array_values($this->_aConfig["phases"][$sPhase]["deploytimes"]))
. '<br>';
}
if ($bActions) {
$sReturn .= $this->renderLink("deploy", $sPhase);
......
......@@ -16,25 +16,12 @@ $aConfig=array(
),
// rsync of archives
'mirrorPackages'=>array(
'puppet'=>array(
'type'=>'rsync',
'runas'=>'www-data', // nur fuer commandline
'target'=>'ladmin@calcium.iml.unibe.ch:/share/imldeployment',
),
),
'mirrorPackages'=>array(),
'phases'=>array(
"preview"=>array(
),
"stage"=>array(
/*
"deploytimes"=>array(
'/(Mon|Tue|Wed|Thu)\ 15\:0/',
),
*/
),
"preview"=>array(),
"stage"=>array(),
"live"=>array(
// wenn deploytimes existiert, dann wird nach dem Deploy das Paket
// in einer Queue zurueckgehalten
......@@ -55,6 +42,17 @@ if ($_SERVER && array_key_exists("SERVER_NAME", $_SERVER)){
$aProjects["scrudu"]["phases"]["preview"]["url"]="http://localhost/deployment/";
break;
case "ci.iml.unibe.ch":
// synch der Pakete nur auf dem Livesystem
$aConfig['mirrorPackages']=array(
'puppet'=>array(
'type'=>'rsync',
'runas'=>'www-data', // nur fuer commandline
'target'=>'ladmin@calcium.iml.unibe.ch:/share/imldeployment',
));
break;
default:
break;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment