provison template

This commit is contained in:
CHIEFSOFT\ameye
2025-09-28 16:41:18 -04:00
parent a7a68ec322
commit 06a142f81f
+27 -2
View File
@@ -218,13 +218,38 @@ class Provision extends BaseController
return 0;
}
private function prepareTemplateFile($composer_template_contents, $ContainerName, $allocatedPort, $provisionUID, $ansible_folder, $productId, $internalUrl): string
private function assignProvideImageName($productId, $provisionUID)
{
$PROVISION_IMAGE_NAME = match ($productId) {
"A000001" => "registry.chiefsoft.com/pweb/pweb-01-merms-pweb0006c:latest",
"A000002" => "registry.chiefsoft.com/bweb/bweb-01-merms-pweb0006c:latest",
default => '',
};
// let us confirm if we have a custom template for this line
$provisionUID = trim($provisionUID);
$mysql = "SELECT FROM members_products WHERE uid::text == '$provisionUID'";
$query = $this->db->query($mysql);
$result = $query->getResult()[0];
$product_template = $result["product_template"];
$custom_template = $result["custom_template"];
log_message('critical', "***** ***** assignProvideImageName ProductTemplate: $product_template CustomTemplate: $custom_template ");
return $PROVISION_IMAGE_NAME;
}
private function prepareTemplateFile($composer_template_contents, $ContainerName, $allocatedPort, $provisionUID, $ansible_folder, $productId, $internalUrl): string
{
// $PROVISION_IMAGE_NAME = match ($productId) {
// "A000001" => "registry.chiefsoft.com/pweb/pweb-01-merms-pweb0006c:latest",
// "A000002" => "registry.chiefsoft.com/bweb/bweb-01-merms-pweb0006c:latest",
// default => '',
// };
//
$PROVISION_IMAGE_NAME = $this->assignProvideImageName($productId, $provisionUID);
$partMachineLocal = $_ENV['PATH_MACHINE_LOCAL'];
$SITE_CONTENTS_GATEWAY = $_ENV['SITE_CONTENTS_GATEWAY'];
$SITE_CONTACT_GATEWAY = $_ENV['SITE_CONTACT_GATEWAY'];
@@ -995,7 +1020,7 @@ class Provision extends BaseController
public function QuickFix()
{
return $this->configureHaproxyURL('sanyaameye.pers.mermsemr.com','10.13.1.28','4400');
return $this->configureHaproxyURL('sanyaameye.pers.mermsemr.com', '10.13.1.28', '4400');
}