浏览代码

playbook updated fixing kea service not found

Guillermo Espinoza 6 年之前
父节点
当前提交
6cfe3a4258
共有 2 个文件被更改,包括 14 次插入2 次删除
  1. 7 1
      tools/src/ReleaseImages.php
  2. 7 1
      tools/src/UpdateImages.php

+ 7 - 1
tools/src/ReleaseImages.php

@@ -359,8 +359,14 @@ class ReleaseImages extends Command
             } else {
                 copy(getcwd() . "/playbookSupport.yml", $path . "/playbook.yml");
                 copy(getcwd() . "/get_supervisord_files.sh", $path . "/get_supervisord_files.sh");
+
+                // KEA selected for install, copy the file get_kea_files.sh
+                // otherwise delete the file if exists in the path
+                $keaFile = "{$path}/get_kea_files.sh";
                 if ($this->isModuleAvailable(new Kea())) {
-                    copy(getcwd() . "/get_kea_files.sh", $path . "/get_kea_files.sh");
+                    copy(getcwd() . "/get_kea_files.sh", $keaFile);
+                } elseif (file_exists($keaFile) === true) {
+                    unlink($keaFile);
                 }
             }
             // copio el script de base de datos inicial

+ 7 - 1
tools/src/UpdateImages.php

@@ -174,9 +174,15 @@ class UpdateImages extends ReleaseImages
             // copio el playbook
             copy(getcwd() . "/playbookUpdateSupport.yml", $path . "/playbook.yml");
 
+            // KEA selected for install, copy the file get_kea_files.sh
+            // otherwise delete the file if exists in the path
+            $keaFile = "{$path}/get_kea_files.sh";
             if ($this->isModuleAvailable(new Kea())) {
-                copy(getcwd() . "/get_kea_files.sh", $path . "/get_kea_files.sh");
+                copy(getcwd() . "/get_kea_files.sh", $keaFile);
+            } elseif (file_exists($keaFile) === true) {
+                unlink($keaFile);
             }
+
             copy(getcwd() . "/get_supervisord_files.sh", $path . "/get_supervisord_files.sh");
         } catch (\Throwable $t) {
             $output->writeln($t->getTraceAsString());