فهرست منبع

Modified stats and added project gitlab

Jean Sumara Leopoldo 5 سال پیش
والد
کامیت
e26fb457cf
3فایلهای تغییر یافته به همراه18 افزوده شده و 17 حذف شده
  1. 4 1
      tools/modules.gitlab.ini
  2. 4 1
      tools/modules.ini
  3. 10 15
      tools/src/Services/Stats_cmd.php

+ 4 - 1
tools/modules.gitlab.ini

@@ -59,4 +59,7 @@ repo = "https://${GITLAB_USER}:${GITLAB_PASS}@gitlab.com/interlink-sa/flowdat3/m
 repo = "https://${GITLAB_USER}:${GITLAB_PASS}@gitlab.com/interlink-sa/flowdat3/modules/tftp.git"
 
 [export]
-repo = "https://${GITLAB_USER}:${GITLAB_PASS}@gitlab.com/interlink-sa/flowdat3/modules/export.git"
+repo = "https://${GITLAB_USER}:${GITLAB_PASS}@gitlab.com/interlink-sa/flowdat3/modules/export.git"
+
+[stats_command]
+repo = "https://${GITLAB_USER}:${GITLAB_PASS}@gitlab.com/interlink-sa/flowdat3/modules/stats_command.git"

+ 4 - 1
tools/modules.ini

@@ -59,4 +59,7 @@ repo = "ssh://git@gitlab.com/interlink-sa/flowdat3/modules/swagger.git"
 repo = "ssh://git@gitlab.com/interlink-sa/flowdat3/modules/tftp.git"
 
 [export]
-repo = "ssh://git@gitlab.com/interlink-sa/flowdat3/modules/export.git"
+repo = "ssh://git@gitlab.com/interlink-sa/flowdat3/modules/export.git"
+
+[stats_command]
+repo = "ssh://git@gitlab.com/interlink-sa/flowdat3/modules/stats_command.git"

+ 10 - 15
tools/src/Services/Stats_cmd.php

@@ -23,7 +23,7 @@ class Stats_cmd extends InitialService
             ->setHostEnv(false)
             ->setVarEnv([])
             ->setOauth(false)
-            ->setRequired(false)
+            ->setRequired(true)
             ->setDepends(['stats']);
     }
 
@@ -33,29 +33,26 @@ class Stats_cmd extends InitialService
      */
     public function add()
     {
-        $module = $this->getModuleName();
-        $initial = $this->getInitialName();
+        $module = "stats_command";
         $version = "latest";
         $registry = "";
+        $host_env_file = "";
         extract($this->getConfigVar());
         if ($this->getRelease()->needInstallModule($module)) {
             $this->getComposer()->addService($module)
-                ->image($registry . "fd3/$initial:" . $version);
+                ->image($registry . "fd3/$module:" . $version);
             if ($this->getProduction() === false) {
                 $this->getComposer()->service($module)
-                    ->build("./$initial/")
-                    ->addVolumes("./$initial/", "/opt/$initial/");
+                    ->build("./$module/")
+                    ->addVolumes("./$module/", "/opt/$module/");
             }
             $this->getComposer()->service($module)
                 ->hostname($module)
-                ->command("bin/console rabbitmq:consumer command_consumer")
                 ->restart($this->getRelease()->_docker_restart_task)
-                ->addEnv_file($this->getRelease()->_running_env)
                 ->addEnv_file($this->getRelease()->_host_env)
-                ->addEnv_file("$initial." . $this->getRelease()->_host_env)
-                ->addEnviroment("AMQP_KEY", $initial)
+                ->addEnviroment("DEV_MODE", $this->getProduction() === false ? 1 : 0)
+                ->addEnv_file("mysql." . $host_env_file)
                 ->addVolumes("/etc/localtime:/etc/localtime:ro")
-                ->addVolumes("./hosts:/etc/hosts")
                 ->network($this->getRelease()->_network_name)->ipv4_address($this->generateIP());
             if ($this->getRelease()->isModuleAvailable(new Geoserver())) {
                 $this->getComposer()->service($module)
@@ -63,10 +60,8 @@ class Stats_cmd extends InitialService
             }
 
             $this->addLink(new Mysql(), $module)
-                ->addLink(new Base(), $module)
-                ->addLink(new Geoserver(), $module)
-                ->addLinkNginx(new Base(), $module)
-                ->addLinkNginx(new Geoserver(), $module);
+                ->addLink(new Redis(), $module)
+                ->addLink(new Amqp(), $module);
         }
     }
 }