merm image dynamics
This commit is contained in:
@@ -94,7 +94,7 @@ class Provision extends BaseController
|
|||||||
|
|
||||||
// $sql = "GRANT SELECT , INSERT , UPDATE , DELETE ON " . $dbName . " . * TO '" . $dbName . "'@'localhost' IDENTIFIED BY '" . $provisionUID . "'";
|
// $sql = "GRANT SELECT , INSERT , UPDATE , DELETE ON " . $dbName . " . * TO '" . $dbName . "'@'localhost' IDENTIFIED BY '" . $provisionUID . "'";
|
||||||
$sql = "GRANT CREATE, SELECT , INSERT , UPDATE , DELETE ON " . $dbName . " . * TO '" . $dbName . "'@'localhost' IDENTIFIED BY '" . $provisionUID . "'";
|
$sql = "GRANT CREATE, SELECT , INSERT , UPDATE , DELETE ON " . $dbName . " . * TO '" . $dbName . "'@'localhost' IDENTIFIED BY '" . $provisionUID . "'";
|
||||||
log_message('critical', "***** ***** prepareDataBase :: GrantQuery === ".$sql);
|
log_message('critical', "***** ***** prepareDataBase :: GrantQuery === " . $sql);
|
||||||
|
|
||||||
$result = mysqli_query($conn, $sql);
|
$result = mysqli_query($conn, $sql);
|
||||||
|
|
||||||
@@ -432,6 +432,7 @@ class Provision extends BaseController
|
|||||||
foreach ($provision_list as $pr) {
|
foreach ($provision_list as $pr) {
|
||||||
$this->db->query("UPDATE member_product_refresh SET status = status + 1 WHERE id = " . $pr->id);
|
$this->db->query("UPDATE member_product_refresh SET status = status + 1 WHERE id = " . $pr->id);
|
||||||
$subscriptionUId = $pr->subscription_uid;
|
$subscriptionUId = $pr->subscription_uid;
|
||||||
|
$this->auditProvisionPlans($subscriptionUId);
|
||||||
if ($this->refreshProvision($subscriptionUId) == 100) {
|
if ($this->refreshProvision($subscriptionUId) == 100) {
|
||||||
log_message('critical', "***** ***** scheduleRefreshAction Started:: () ");
|
log_message('critical', "***** ***** scheduleRefreshAction Started:: () ");
|
||||||
}
|
}
|
||||||
@@ -445,12 +446,38 @@ class Provision extends BaseController
|
|||||||
foreach ($provision_list as $pr) {
|
foreach ($provision_list as $pr) {
|
||||||
$this->db->query("UPDATE member_product_refresh SET status = status + 1 WHERE id = " . $pr->id);
|
$this->db->query("UPDATE member_product_refresh SET status = status + 1 WHERE id = " . $pr->id);
|
||||||
$subscriptionUId = $pr->subscription_uid;
|
$subscriptionUId = $pr->subscription_uid;
|
||||||
|
$this->auditProvisionPlans($subscriptionUId);
|
||||||
if ($this->refreshBlogProvision($subscriptionUId) == 100) {
|
if ($this->refreshBlogProvision($subscriptionUId) == 100) {
|
||||||
log_message('critical', "***** ***** scheduleRefresh BLOG Action Started:: () ");
|
log_message('critical', "***** ***** scheduleRefresh BLOG Action Started:: () ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function auditProvisionPlans($subscriptionUid): void
|
||||||
|
{
|
||||||
|
// Where is your provision plan
|
||||||
|
//SELECT * from provision_plans where provision_id = 46;
|
||||||
|
//SELECT uid id,provision_status, status FROM members_products WHERE id = 46
|
||||||
|
try {
|
||||||
|
$sqlP = "SELECT * FROM members_products WHERE uid::text = '$subscriptionUid' ";
|
||||||
|
$query = $this->db->query($sqlP);
|
||||||
|
$row = $query->row();
|
||||||
|
if (isset($row)) {
|
||||||
|
echo $row->title;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
} catch (Exception $e) {
|
||||||
|
// Handle the specific exception
|
||||||
|
echo "Caught exception: " . $e->getMessage() . "\n";
|
||||||
|
} finally {
|
||||||
|
// Cleanup code, always runs
|
||||||
|
echo "Attempted file operation finished.\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private function refreshBlogProvision($subscriptionUId): int
|
private function refreshBlogProvision($subscriptionUId): int
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -515,6 +542,7 @@ class Provision extends BaseController
|
|||||||
// let us make sure all we promise are availale
|
// let us make sure all we promise are availale
|
||||||
//"WHAT_PART_LOCAL
|
//"WHAT_PART_LOCAL
|
||||||
|
|
||||||
|
$CURRENT_IMAGE_REFRESH = "registry.chiefsoft.com/a000001/personal-web-web0002a:latest";
|
||||||
|
|
||||||
// Remember this is in a CONTAINER so the path follows
|
// Remember this is in a CONTAINER so the path follows
|
||||||
$this_composer_part_location = "/var/www/html/ANSIBLE/parts/" . $productUid;
|
$this_composer_part_location = "/var/www/html/ANSIBLE/parts/" . $productUid;
|
||||||
@@ -546,7 +574,8 @@ class Provision extends BaseController
|
|||||||
\"WHAT_PART_REMOTE\":\"$composer_template_path_remote\",
|
\"WHAT_PART_REMOTE\":\"$composer_template_path_remote\",
|
||||||
\"ANSIBLE_TRANSPORT_PATH\":\"$ansible_transport_path\",
|
\"ANSIBLE_TRANSPORT_PATH\":\"$ansible_transport_path\",
|
||||||
\"RSYNC_PASSWORD\":\"$rsyncPass\",
|
\"RSYNC_PASSWORD\":\"$rsyncPass\",
|
||||||
\"CONTAINER_NAME\":\"$ContainerName\"
|
\"CONTAINER_NAME\":\"$ContainerName\",
|
||||||
|
\"CURRENT_IMAGE_REFRESH\":\"$CURRENT_IMAGE_REFRESH\"
|
||||||
}"
|
}"
|
||||||
];
|
];
|
||||||
log_message('critical', "02- ANSIBLE CALL PARAMETERS ********* " . serialize($params));
|
log_message('critical', "02- ANSIBLE CALL PARAMETERS ********* " . serialize($params));
|
||||||
@@ -653,7 +682,7 @@ class Provision extends BaseController
|
|||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
private function registerProvision($subscriptionId, $prov_name)
|
private function registerProvision($subscriptionId, $prov_name): int
|
||||||
{
|
{
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user