Explorar el Código

Merge branch 'master' of bitbucket.org:ikflowdat/installer

Luciano Andrade hace 7 años
padre
commit
d61ed2bcde
Se han modificado 1 ficheros con 57 adiciones y 3 borrados
  1. 57 3
      tools/src/Release.php

+ 57 - 3
tools/src/Release.php

@@ -189,7 +189,16 @@ class Release extends Command
                 'HOST_ENV' => false,
                 'OAUTH' => false,
                 'MODULE_INSTALL' => true
-            )
+            ),
+            "geoserver" => array(
+                'HOST_ENV' => true,
+                "VAR_ENV" => array(
+                    'VIRTUAL_HOST' => '',
+                    'HTTPS_METHOD' => 'nohttps',
+                ),
+                'OAUTH' => false,
+                'MODULE_INSTALL' => true
+            ),
         );
     }
 
@@ -575,10 +584,15 @@ class Release extends Command
             ->addVolumes("./mongodb", "/data/db");
     }
 
+    /**
+    * @param FileFormat2 $composer
+    * @param array $config
+    */
     function addSupervisord(FileFormat2 $composer, $config = array())
     {
         $version = "latest";
         $registry = "";
+        $host_env_file = "";
         extract($config);
 
         $composer
@@ -587,11 +601,20 @@ class Release extends Command
             ->image($registry . "fd3/supervisord:$version")
             ->privileged(true)
             ->restart($this->_docker_restart_default)
+            ->addLinks("geoserver")
+            ->addLinks("nginx", $this->getDomain("geoserver"))
             ->addVolumes("./extra/supervisord/", "/etc/supervisord/")
             ->addVolumes("./extra/supervisord/var/", "/var/log/supervisor/")
             ->addVolumes("./extra/supervisord/sshd_config", "/etc/ssh/sshd_config")
             ->addVolumes("./extra/supervisord/bin/fiberhome", "/usr/bin/fiberhome")
-            ->addVolumes("./extra/supervisord/bin/fiberlink", "/usr/bin/fiberlink");
+            ->addVolumes("./extra/supervisord/bin/fiberlink", "/usr/bin/fiberlink")
+            ->addVolumes("./extra/supervisord/bin/huawei", "/usr/bin/huawei")
+            ->addVolumes("./stats", "/opt/stats")
+            ->addEnv_file("running.env")
+            ->addEnv_file($host_env_file)
+            ->addEnv_file("stats.host.env")
+            ->addEnv_file("stats.oauth.env")
+            ;
     }
 
     function addMySql(FileFormat2 $composer, $config = array())
@@ -823,10 +846,38 @@ class Release extends Command
         ->addLinks("base")
         ->addLinks("amqp")
         ->addLinks("nginx", $this->getDomain("base"))
+        ->addLinks("geoserver")
+        ->addLinks("nginx", $this->getDomain("geoserver"))
         ->addEnv_file("running.env")
         ->addEnv_file("host.env")
         ->addEnviroment("AMQP_KEY", "stats")
-        ->addVolumes("./stats/", "/opt/stats");
+        ->addVolumes("./stats/", "/opt/stats")
+        ->addVolumes("./geoserver/geoserver-shapes", "/var/www/shapes")
+        ;
+    }
+
+    /**
+    * @param FileFormat2 $composer
+    * @param array $config
+    */
+    public function addGeoserver(FileFormat2 $composer, $config = array())
+    {
+        $version = "latest";
+        $registry = "";
+        extract($config);
+
+        $composer
+        ->addService("geoserver")
+        ->image($registry . "fd3/geoserver:" . $version)
+        ->build("./extra/geoserver/")
+        ->restart($this->_docker_restart_default)
+        ->addLinks("nginx", $this->getDomain("geoserver"))
+        ->addEnv_file("running.env")
+        ->addEnv_file("host.env")
+        ->addVolumes("./extra/geoserver/geoserver-data/styles", "/opt/geoserver/data_dir/styles")
+        ->addVolumes("./geoserver/geoserver-shapes", "/var/www/shapes")
+        ->addPorts(8081, 8080)
+        ;
     }
 
 
@@ -869,6 +920,9 @@ class Release extends Command
         $this->addSupervisord($composer, $base_vars);
         $this->addCommandWorkers($composer, $base_vars);
 
+        // Geoserver
+        $this->addGeoserver($composer, $base_vars);
+
         $this->_dObj->file("docker-compose.yml")->content($composer->render());
 
         // escribo un archivo inventory.ini por defecto para no tener que lanzar los docker