Fix config
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
CONFIG_NAME='This is NOT development. It is not how envrionment works in CodeIgniter!'
|
CONFIG_NAME='This is NOT development. It is not how environment works in CodeIgniter!'
|
||||||
CONTAINER_PORT=8094
|
CONTAINER_PORT=8094
|
||||||
UID=1000
|
UID=1000
|
||||||
|
|
||||||
@@ -37,6 +37,8 @@ PROVISION_MSQL_DATABASE_PASSWORD="may12002!"
|
|||||||
PROVISION_MSQL_DATABASE="wordpress"
|
PROVISION_MSQL_DATABASE="wordpress"
|
||||||
PROVISION_MSQL_DATABASE_PORT="3307"
|
PROVISION_MSQL_DATABASE_PORT="3307"
|
||||||
|
|
||||||
|
SITE_CONTENTS_GATEWAY="http://10.10.10.101:14700/web/contents"
|
||||||
|
SITE_CONTACT_GATEWAY="http://10.10.10.101:14700/web/contacts"
|
||||||
|
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ PROVISION_MSQL_DATABASE_PASSWORD="may12002!"
|
|||||||
PROVISION_MSQL_DATABASE="wordpress"
|
PROVISION_MSQL_DATABASE="wordpress"
|
||||||
PROVISION_MSQL_DATABASE_PORT="3307"
|
PROVISION_MSQL_DATABASE_PORT="3307"
|
||||||
|
|
||||||
|
SITE_CONTENTS_GATEWAY="http://10.10.11.41:14700/web/contents"
|
||||||
|
SITE_CONTACT_GATEWAY="http://10.10.11.41:14700/web/contacts"
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# Example Environment Configuration file
|
# Example Environment Configuration file
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ namespace App\Controllers;
|
|||||||
|
|
||||||
class Provision extends BaseController
|
class Provision extends BaseController
|
||||||
{
|
{
|
||||||
private function testSocket(): void{
|
private function testSocket(): void
|
||||||
|
{
|
||||||
// TELL THE SOCKET TO REFRESH PAGE
|
// TELL THE SOCKET TO REFRESH PAGE
|
||||||
$data["product_uid"] = "bea86662-adb3-4c09-816b-014f450d9713";
|
$data["product_uid"] = "bea86662-adb3-4c09-816b-014f450d9713";
|
||||||
$data["provision_action"] = "Auto%20Configuration%20Started";
|
$data["provision_action"] = "Auto%20Configuration%20Started";
|
||||||
@@ -19,7 +20,7 @@ class Provision extends BaseController
|
|||||||
|
|
||||||
//$this->testSocket();
|
//$this->testSocket();
|
||||||
$current_database = $_ENV['MAIN_DATABASE_IP'];
|
$current_database = $_ENV['MAIN_DATABASE_IP'];
|
||||||
log_message('critical', "***** ***** prepareProvision :: Working Database ".$current_database );
|
log_message('critical', "***** ***** prepareProvision :: Working Database " . $current_database);
|
||||||
|
|
||||||
log_message('critical', "***** ***** prepareProvision :: Starting Port Allocation ");
|
log_message('critical', "***** ***** prepareProvision :: Starting Port Allocation ");
|
||||||
$this->allocatePortNo(); // allocte port for the conyainer use
|
$this->allocatePortNo(); // allocte port for the conyainer use
|
||||||
@@ -173,16 +174,19 @@ class Provision extends BaseController
|
|||||||
// Do the processing
|
// Do the processing
|
||||||
$composer_template_contents = str_replace("WHAT_CONTAINER_NAME", $ContainerName, $composer_template_contents);
|
$composer_template_contents = str_replace("WHAT_CONTAINER_NAME", $ContainerName, $composer_template_contents);
|
||||||
//$destinationHomeFolder = "/home/chiefsoft/SITES/" . $ContainerName;
|
//$destinationHomeFolder = "/home/chiefsoft/SITES/" . $ContainerName;
|
||||||
|
$SITE_CONTENTS_GATEWAY = $_ENV['SITE_CONTENTS_GATEWAY'];
|
||||||
|
$SITE_CONTACT_GATEWAY = $_ENV['SITE_CONTACT_GATEWAY'];
|
||||||
|
$MYSQL_PROVISION_DATABASE_PORT = $_ENV['PROVISION_MSQL_DATABASE_IP'] . ":" . $_ENV['PROVISION_MSQL_DATABASE_PORT']; // "172.16.4.96:3307";
|
||||||
$destinationHomeFolder = $_ENV['DESTINATION_HOME_FOLDER'] . $ContainerName;
|
$destinationHomeFolder = $_ENV['DESTINATION_HOME_FOLDER'] . $ContainerName;
|
||||||
$composer_template_contents = str_replace("DESTINATION_FOLDER", $destinationHomeFolder, $composer_template_contents);
|
$composer_template_contents = str_replace("DESTINATION_FOLDER", $destinationHomeFolder, $composer_template_contents);
|
||||||
$composer_template_contents = str_replace("ALLOCATED_PORT", $allocatedPort, $composer_template_contents);
|
$composer_template_contents = str_replace("ALLOCATED_PORT", $allocatedPort, $composer_template_contents);
|
||||||
$composer_template_contents = str_replace("CNT_DB_NAME", $ContainerName, $composer_template_contents);
|
$composer_template_contents = str_replace("CNT_DB_NAME", $ContainerName, $composer_template_contents);
|
||||||
$composer_template_contents = str_replace("CNT_DB_PASS", $provisionUID, $composer_template_contents);
|
$composer_template_contents = str_replace("CNT_DB_PASS", $provisionUID, $composer_template_contents);
|
||||||
$composer_template_contents = str_replace("CNT_DB_DATA", '172.16.4.96:3307', $composer_template_contents);
|
$composer_template_contents = str_replace("CNT_DB_DATA", $MYSQL_PROVISION_DATABASE_PORT, $composer_template_contents);
|
||||||
$composer_template_contents = str_replace("PROVISION_UID_REPLACE", $provisionUID, $composer_template_contents);
|
$composer_template_contents = str_replace("PROVISION_UID_REPLACE", $provisionUID, $composer_template_contents);
|
||||||
$composer_template_contents = str_replace("PROVISION_IMAGE_NAME_REPLACE","registry.chiefsoft.com/pweb/pweb-01-merms-pweb0006c:latest", $composer_template_contents);
|
$composer_template_contents = str_replace("PROVISION_IMAGE_NAME_REPLACE", "registry.chiefsoft.com/pweb/pweb-01-merms-pweb0006c:latest", $composer_template_contents);
|
||||||
$composer_template_contents = str_replace("SITE_CONTENTS_URL_REPLACE", "http://10.10.10.101:14700/web/contents", $composer_template_contents);
|
$composer_template_contents = str_replace("SITE_CONTENTS_URL_REPLACE", $SITE_CONTENTS_GATEWAY, $composer_template_contents);
|
||||||
$composer_template_contents = str_replace("SITE_CONTACT_URL_REPLACE", "http://10.10.10.101:14700/web/contacts", $composer_template_contents);
|
$composer_template_contents = str_replace("SITE_CONTACT_URL_REPLACE", $SITE_CONTACT_GATEWAY, $composer_template_contents);
|
||||||
|
|
||||||
$templateRandom = 'P' . rand(1, 6);
|
$templateRandom = 'P' . rand(1, 6);
|
||||||
$composer_template_contents = str_replace("TEMPLATE_NAME_REPLACE", $templateRandom, $composer_template_contents);
|
$composer_template_contents = str_replace("TEMPLATE_NAME_REPLACE", $templateRandom, $composer_template_contents);
|
||||||
@@ -375,16 +379,19 @@ class Provision extends BaseController
|
|||||||
// Do the processing
|
// Do the processing
|
||||||
$composer_template_contents = str_replace("WHAT_CONTAINER_NAME", $ContainerName, $composer_template_contents);
|
$composer_template_contents = str_replace("WHAT_CONTAINER_NAME", $ContainerName, $composer_template_contents);
|
||||||
//$destinationHomeFolder = "/home/chiefsoft/SITES/" . $ContainerName;
|
//$destinationHomeFolder = "/home/chiefsoft/SITES/" . $ContainerName;
|
||||||
|
$SITE_CONTENTS_GATEWAY = $_ENV['SITE_CONTENTS_GATEWAY'];
|
||||||
|
$SITE_CONTACT_GATEWAY = $_ENV['SITE_CONTACT_GATEWAY'];
|
||||||
|
$MYSQL_PROVISION_DATABASE_PORT = $_ENV['PROVISION_MSQL_DATABASE_IP'] . ":" . $_ENV['PROVISION_MSQL_DATABASE_PORT']; // "172.16.4.96:3307";
|
||||||
$destinationHomeFolder = $_ENV['DESTINATION_HOME_FOLDER'] . $ContainerName;
|
$destinationHomeFolder = $_ENV['DESTINATION_HOME_FOLDER'] . $ContainerName;
|
||||||
$composer_template_contents = str_replace("DESTINATION_FOLDER", $destinationHomeFolder, $composer_template_contents);
|
$composer_template_contents = str_replace("DESTINATION_FOLDER", $destinationHomeFolder, $composer_template_contents);
|
||||||
$composer_template_contents = str_replace("ALLOCATED_PORT", $allocatedPort, $composer_template_contents);
|
$composer_template_contents = str_replace("ALLOCATED_PORT", $allocatedPort, $composer_template_contents);
|
||||||
$composer_template_contents = str_replace("CNT_DB_NAME", $ContainerName, $composer_template_contents);
|
$composer_template_contents = str_replace("CNT_DB_NAME", $ContainerName, $composer_template_contents);
|
||||||
$composer_template_contents = str_replace("CNT_DB_PASS", $provisionUID, $composer_template_contents);
|
$composer_template_contents = str_replace("CNT_DB_PASS", $provisionUID, $composer_template_contents);
|
||||||
$composer_template_contents = str_replace("CNT_DB_DATA", '172.16.4.96:3307', $composer_template_contents);
|
$composer_template_contents = str_replace("CNT_DB_DATA", $MYSQL_PROVISION_DATABASE_PORT, $composer_template_contents);
|
||||||
$composer_template_contents = str_replace("PROVISION_UID_REPLACE", $provisionUID, $composer_template_contents);
|
$composer_template_contents = str_replace("PROVISION_UID_REPLACE", $provisionUID, $composer_template_contents);
|
||||||
$composer_template_contents = str_replace("PROVISION_IMAGE_NAME_REPLACE","registry.chiefsoft.com/pweb/pweb-01-merms-pweb0006c:latest", $composer_template_contents);
|
$composer_template_contents = str_replace("PROVISION_IMAGE_NAME_REPLACE", "registry.chiefsoft.com/pweb/pweb-01-merms-pweb0006c:latest", $composer_template_contents);
|
||||||
$composer_template_contents = str_replace("SITE_CONTENTS_URL_REPLACE", "http://10.10.10.101:14700/web/contents", $composer_template_contents);
|
$composer_template_contents = str_replace("SITE_CONTENTS_URL_REPLACE", $SITE_CONTENTS_GATEWAY, $composer_template_contents);
|
||||||
$composer_template_contents = str_replace("SITE_CONTACT_URL_REPLACE", "http://10.10.10.101:14700/web/contacts", $composer_template_contents);
|
$composer_template_contents = str_replace("SITE_CONTACT_URL_REPLACE", $SITE_CONTACT_GATEWAY, $composer_template_contents);
|
||||||
|
|
||||||
|
|
||||||
$templateRandom = 'P' . rand(1, 6);
|
$templateRandom = 'P' . rand(1, 6);
|
||||||
|
|||||||
Reference in New Issue
Block a user