deployment
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
root
2024-08-27 10:18:48 +02:00
parent a12b947086
commit 0801358211

View File

@@ -99,31 +99,44 @@ switch ($_GET["op"]) {
} }
else echo ""; else echo "";
break; break;
case "deployment":
$arr = array("NAME" => $_GET["additional"], "ACTION" => "ask");
$json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
$op = "deployment";
redis_set($op,$json);
echo "OK"; // TODO?
break;
case "deploy": case "deploy":
if ($key=check_deploy()) { if ($key=check_deploy()) {
$header_text="A deployment has already started.<br>Please wait and do not start a new one..."; $text="A deployment has already started.<br>Please wait and do not start a new one...";
} }
else { else {
$header_text="Installing in progress... Please wait..."; $text="Installing in progress... Please wait...";
$key = "deploy:".date("YmdHis"); $arr = array("NAME" => $_GET["additional"], "ACTION" => "deploy");
redis_set($key,$json); $json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
//$key = "deploy:20240816101849"; // DEBUG
$op = "deployment";
redis_set($op,$json);
} }
echo $text;
break; break;
case "check_deploy": case "check_deployment":
$arr = check_redis("web_out",$_GET["key"]); $arr = check_redis("web_out","deployment");
if (!empty($arr)) { if (!empty($arr)) {
foreach ($arr as $key=>$data) { foreach ($arr as $key=>$data) {
//echo $key."-".$_GET["key"]; if ($key=="deployment") {
if ($key==$_GET["key"]) { // if install key moved to web_out if ($data["STATUS"]=="0") { // ask
if ($data["INSTALL_STATUS"]>0) { echo base64_decode($data["TEMPLATE"]);
redis_remove("$key");
echo "INSTALLED";
} }
else {
echo $data["STATUS"];
}
redis_remove("$key");
} }
} }
} }
else echo "NOT EXISTS"; else echo "";
break; break;
case "repositories": case "repositories":
$arr = array("STATUS" => 0); $arr = array("STATUS" => 0);