Selaa lähdekoodia

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

iksop 7 vuotta sitten
vanhempi
commit
49822d9d66
3 muutettua tiedostoa jossa 97 lisäystä ja 67 poistoa
  1. 39 38
      .drone.yml
  2. 0 25
      tec.txt
  3. 58 4
      tools/src/Release.php

+ 39 - 38
.drone.yml

@@ -10,13 +10,15 @@ services:
 
 pipeline:
   docker_installer:
-    environment:
+   environment:
       - DIR_INSTALL=/opt/installer
    repo : docker.infra.flowdat.com/fd3/installer
    image: plugins/docker
    email: luciano@interlink.com.ar
    registry: docker.infra.flowdat.com
    dockerfile: tools/Dockerfile
+   build_args:
+      - DIR_INSTALL=/opt/installer
    context: tools/
    tag:
      - latest
@@ -33,42 +35,41 @@ pipeline:
   #    - pwd
   #    - ls -lash
   #    - cd behat/testScreenshotGalvez ; php ./vendor/bin/codecept run --steps tests/acceptance/
-  install:
-    image: docker.infra.flowdat.com/fd3/sf-php:latest
-    environment:
-      - DOCKER_HOST=tcp://0.0.0.0:2375
-    commands:
-      - apt-get update && apt-get  install -yq php-gmp
-      - apt-get update && apt-get install -yq lsb-release time
-      - . /etc/os-release; echo $ID
-      - lsb_release -cs
-      - env
-      - php -v
-      - apt-get update && apt-get install -yq apt-transport-https ca-certificates curl gnupg2 software-properties-common
-      - curl -fsSL https://download.docker.com/linux/$ID/gpg | apt-key add -
-      - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$ID $(lsb_release -cs) stable"
-      - apt-get update && apt-cache madison docker-ce
-      - apt-get update && apt-get -yq install docker-ce=17.06.0~ce-0~debian
-      - apt-get update && apt-get  install -yq python-pip
-      - docker --tls=false ps -a
-      - pip install docker-compose
-      - docker-compose -v
-      - echo "Hasta aqui es instalación de paquetes requeridos docker y docker-compose"
-      - cd tools 
-      - chmod 0600 keys/bitbucket.id_rsa*
-      - eval $(ssh-agent) ; ssh-add keys/bitbucket.id_rsa
-      - composer install --no-interaction --no-progress -vvv
-      - rm -rf demo
-      - php cmd.php make:install demo
-      - ping bitbucket.org -c4
-      - cd demo 
-      - php ../cmd.php get:source git.ini
-      - cat docker-compose.yml
-      - docker-compose config
-      - time docker-compose build
-      - docker-compose up -d
-      - docker-compose ps 
-      - "curl -H 'Host: base.fd3.flowdat.com' 127.0.0.1"
 
-  
+  #install:
+  #  image: docker.infra.flowdat.com/fd3/sf-php:latest
+  #  environment:
+  #    - DOCKER_HOST=tcp://0.0.0.0:2375
+  #  commands:
+  #    - apt-get update && apt-get  install -yq php-gmp
+  #    - apt-get update && apt-get install -yq lsb-release time
+  #    - . /etc/os-release; echo $ID
+  #    - lsb_release -cs
+  #    - env
+  #    - php -v
+  #    - apt-get update && apt-get install -yq apt-transport-https ca-certificates curl gnupg2 software-properties-common
+  #    - curl -fsSL https://download.docker.com/linux/$ID/gpg | apt-key add -
+  #    - add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/$ID $(lsb_release -cs) stable"
+  #    - apt-get update && apt-cache madison docker-ce
+  #    - apt-get update && apt-get -yq install docker-ce=17.06.0~ce-0~debian
+  #    - apt-get update && apt-get  install -yq python-pip
+  #    - docker --tls=false ps -a
+  #    - pip install docker-compose
+  #    - docker-compose -v
+  #    - echo "Hasta aqui es instalación de paquetes requeridos docker y docker-compose"
+  #    - cd tools 
+  #    - chmod 0600 keys/bitbucket.id_rsa*
+  #    - eval $(ssh-agent) ; ssh-add keys/bitbucket.id_rsa
+  #    - composer install --no-interaction --no-progress -vvv
+  #    - rm -rf demo
+  #    - php cmd.php make:install demo
+  #    - ping bitbucket.org -c4
+  #    - cd demo 
+  #    - php ../cmd.php get:source git.ini
+  #    - cat docker-compose.yml
+  #    - docker-compose config
+  #    - time docker-compose build
+  #    - docker-compose up -d
+  #    - docker-compose ps 
+  #    - "curl -H 'Host: base.fd3.flowdat.com' 127.0.0.1"
  

+ 0 - 25
tec.txt

@@ -1,25 +0,0 @@
-Linux
-
-PHP
-Symfony
-  Sonata
-  LeafLeat
-
-MySQL 
-
-StatsD
-   Nodejs
-
-MongoDB
-
-Docker
-  Docker-Compose
-
-Supervisor
-
-Python
-  pytelnet
-  twisted
-
-Ansible
-

+ 58 - 4
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
+            ),
         );
     }
 
@@ -560,7 +569,7 @@ class Release extends Command
             ->addPorts(443, 443)
             ->addVolumes("/var/run/docker.sock", "/tmp/docker.sock:ro")
             ->addVolumes("./extra/nginx/certs", "/etc/nginx/certs:ro")
-            ->addVolumes("./extra/nginx/vhost.d", "/etc/nginx/vhost.d")
+            ->addVolumes("./extra/nginx/conf.d", "/etc/nginx/conf.d")
             ->addVolumes("./extra/nginx/share", "/usr/share/nginx/html");
         }
 
@@ -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