$composer_template_path_local

This commit is contained in:
CHIEFSOFT\ameye
2025-01-19 21:04:02 -05:00
parent 129c2f48b0
commit e8d65e1d7f
2 changed files with 5 additions and 3 deletions
+1 -2
View File
@@ -4,9 +4,8 @@
tasks:
- name: Set up docker-compose file
template:
src: "WHAT_PART_FOLDER/docker-compose.yml"
src: "WHAT_PART_FOLDER_LOCAL/docker-compose.yml"
dest: "DESTINATION_FOLDER"
delegate_to: localhost
- name: docker compose up
shell:
+4 -1
View File
@@ -13,7 +13,7 @@ class Home extends BaseController
{
$public_path = FCPATH;
$ansible_folder = str_replace("public/", "ANSIBLE", $public_path);
$partMachineLocal = "/home/chiefsoft/MermsProvision/ANSIBLE/parts/";
if (!is_dir($ansible_folder."/parts") ){
mkdir($ansible_folder."/parts", 0700);
}
@@ -39,6 +39,8 @@ class Home extends BaseController
// THIS PROVISONING COMPOSERS
$composer_template_path = $ansible_folder."/templates/composers/".$productId."/docker-compose.yml";
$composer_template_path_local = $partMachineLocal.$productId."/docker-compose.yml";
$prov_name = str_replace(".", "_", $pr->internal_url).".yml";
$template_file = $ansible_folder ."/templates/".$pr->product_id.".yml";
//Get the domposer template file
@@ -59,6 +61,7 @@ class Home extends BaseController
$template_content_processed = str_replace("WHAT_HOST_IN_USE", $productId."_SERVER", $template_content);
$template_content_processed = str_replace("WHAT_PART_FOLDER", $partFolder, $template_content_processed);
$template_content_processed = str_replace("DESTINATION_FOLDER", $destinationHomeFolder, $template_content_processed);
$template_content_processed = str_replace("WHAT_PART_FOLDER_LOCAL", $composer_template_path_local, $template_content_processed); // depends on the local machine
// CREATE PROVISOINING FILE
$myfile = fopen( $ansible_folder ."/".$prov_name, "w") or die("Unable to open file!");
fwrite($myfile, $template_content_processed);