Template random

This commit is contained in:
CHIEFSOFT\ameye
2025-08-08 21:35:07 -04:00
parent a00e37f5b9
commit f0c56b85c8
3 changed files with 8 additions and 0 deletions
@@ -11,6 +11,7 @@ services:
- ./apache_log:/var/log/apache2:Z
environment:
- PROVISION_UID=PROVISION_UID_REPLACE
- TEMPLATE_NAME=TEMPLATE_NAME_REPLACE
# - APACHE_RUN_USER=1000
# - APACHE_RUN_GROUP=1000
networks:
@@ -11,6 +11,7 @@ services:
- ./apache_log:/var/log/apache2:Z
environment:
- PROVISION_UID=PROVISION_UID_REPLACE
- TEMPLATE_NAME=TEMPLATE_NAME_REPLACE
# - APACHE_RUN_USER=1000
# - APACHE_RUN_GROUP=1000
networks:
+6
View File
@@ -177,6 +177,10 @@ class Provision extends BaseController
$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("PROVISION_UID_REPLACE", $provisionUID, $composer_template_contents);
$templateRandom = rand(1,6).'p';
$composer_template_contents = str_replace("TEMPLATE_NAME_REPLACE", $templateRandom, $composer_template_contents);
//Save to the specific path
$destination_composer_path = $ansible_folder . "/parts/" . $provisionUID . "/docker-compose.yml";
@@ -371,6 +375,8 @@ class Provision extends BaseController
$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("PROVISION_UID_REPLACE", $provisionUID, $composer_template_contents);
$templateRandom = rand(1,6).'p';
$composer_template_contents = str_replace("TEMPLATE_NAME_REPLACE", $templateRandom, $composer_template_contents);
//Save to the specific path
$composerFile = fopen($destination_composer_path, "w") or die("Unable to open file!");
fwrite($composerFile, $composer_template_contents);