Logging retrials

This commit is contained in:
CHIEFSOFT\ameye
2025-07-17 15:02:01 -04:00
parent b03bf48d1a
commit 07b5c9d5fd
+25 -5
View File
@@ -125,6 +125,17 @@ class Provision extends BaseController
$ContainerName = $this->generatedContainerName($productId, $pr->id ); // $productId . str_pad($pr->id, 10, "0", STR_PAD_LEFT); $ContainerName = $this->generatedContainerName($productId, $pr->id ); // $productId . str_pad($pr->id, 10, "0", STR_PAD_LEFT);
$partFolder = $ansible_folder . "/parts/" . $provisionUID; $partFolder = $ansible_folder . "/parts/" . $provisionUID;
// // make sure we compose the docker compose to use
// $this->prepareDockerComposer(
// $subscriptionId,
// $provisionPort,
// $productId,
// $provisionUID,
// $memberID,
// $pr->internal_url
// );
$allocatedPort = $provisionPort; $allocatedPort = $provisionPort;
$this->updateToNow($provisionUID); $this->updateToNow($provisionUID);
@@ -182,6 +193,7 @@ class Provision extends BaseController
$internal_url $internal_url
){ ){
$public_path = FCPATH; $public_path = FCPATH;
$ansible_folder = str_replace("public/", "ANSIBLE", $public_path); $ansible_folder = str_replace("public/", "ANSIBLE", $public_path);
$partMachineLocal = $_ENV['PATH_MACHINE_LOCAL']; $partMachineLocal = $_ENV['PATH_MACHINE_LOCAL'];
@@ -194,6 +206,14 @@ class Provision extends BaseController
$ContainerName = $this->generatedContainerName($productId, $members_product_id ); // $productId . str_pad($pr->id, 10, "0", STR_PAD_LEFT); $ContainerName = $this->generatedContainerName($productId, $members_product_id ); // $productId . str_pad($pr->id, 10, "0", STR_PAD_LEFT);
$partFolder = $ansible_folder . "/parts/" . $member_product_uid; $partFolder = $ansible_folder . "/parts/" . $member_product_uid;
/*
* may be if the file is already there , we can turn back
*
*/
$destination_composer_path = $ansible_folder . "/parts/" . $provisionUID . "/docker-compose.yml";
$allocatedPort = $provisionPort; $allocatedPort = $provisionPort;
$this->updateToNow($provisionUID); $this->updateToNow($provisionUID);
@@ -220,7 +240,6 @@ class Provision extends BaseController
$composer_template_contents = str_replace("CNT_DB_DATA", '172.16.4.96:3307', $composer_template_contents); $composer_template_contents = str_replace("CNT_DB_DATA", '172.16.4.96:3307', $composer_template_contents);
//Save to the specific path //Save to the specific path
$destination_composer_path = $ansible_folder . "/parts/" . $provisionUID . "/docker-compose.yml";
$composerFile = fopen($destination_composer_path, "w") or die("Unable to open file!"); $composerFile = fopen($destination_composer_path, "w") or die("Unable to open file!");
fwrite($composerFile, $composer_template_contents); fwrite($composerFile, $composer_template_contents);
fclose($composerFile); fclose($composerFile);
@@ -418,9 +437,7 @@ class Provision extends BaseController
$provision_port = $pr->provision_port; $provision_port = $pr->provision_port;
$members_product_id = $pr->mpid; $members_product_id = $pr->mpid;
log_message('critical', "Members Product ID ***** ".$pr->mpid." Provision_Status == ". $pr->provision_status);
log_message('critical', "Members Product ID ***** ".$pr->mpid);
$ansible_host = $productId . "_SERVER"; $ansible_host = $productId . "_SERVER";
@@ -438,12 +455,15 @@ 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
// Remember this is in a CONTAINER
// 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;
if (!is_dir( $this_composer_part_location )) { if (!is_dir( $this_composer_part_location )) {
mkdir($this_composer_part_location , 0700); mkdir($this_composer_part_location , 0700);
} }
// make sure we compose the docker compose to use
$this->prepareDockerComposer( $this->prepareDockerComposer(
$members_product_id, $members_product_id,
$provision_port, $provision_port,