瀏覽代碼

Merge branch 'master' into 'FD3-733'

# Conflicts:
#   tools/src/Release.php
Gabriel Gosparo 6 年之前
父節點
當前提交
ba40548e06
共有 4 個文件被更改,包括 38 次插入12 次删除
  1. 12 0
      .gitlab-ci.yml
  2. 21 10
      tools/src/Release.php
  3. 2 1
      tools/src/Services/Ftth_tasklogger_worker.php
  4. 3 1
      tools/src/Services/Tftp.php

+ 12 - 0
.gitlab-ci.yml

@@ -0,0 +1,12 @@
+build_branch:
+    image: docker.infra.flowdat.com/fd3/sf-php:latest
+    script:
+      - chmod 0600 keys/*
+      - eval $(ssh-agent); ssh-add keys/gogs.drone.id_rsa
+      - git fetch --tags 
+      - git remote add gogs ssh://git@gogs.infra.flowdat.com:222/VendorSoftwareFlowdat3/Installer.git
+      - git checkout $CI_COMMIT_REF_NAME
+      - git push -u gogs $CI_COMMIT_REF_NAME --tags
+    only:
+      - pushes
+      - branches

+ 21 - 10
tools/src/Release.php

@@ -84,10 +84,12 @@ class Release extends Command
      * @var array Contiene los usuarios que van a poder acceder al sistema.
      */
     protected $_user_system;
+
     /**
      * @var string $directory Directorio de instalacion
      */
     protected $directory;
+
     /**
      * @var boolean $_use_nginx_links Para indicar si se crean los links nginx entre los modulos
      */
@@ -131,7 +133,6 @@ class Release extends Command
         $this->_mysql_link = "mysql:mysql";
         $this->_running_env = "running.env";
         $this->_host_env = "host.env";
-
         $this->_docker_restart_default = "on-failure:10";
         $this->_user_system = ['users' =>
             [
@@ -271,7 +272,7 @@ class Release extends Command
             $this->_ansible_vars["CMD_USERNAME"] = $this->_user_system['users'][$internal_user_id]['user'];
             $this->_ansible_vars["CMD_PASSWORD"] = $this->_user_system['users'][$internal_user_id]['password'];
             $this->_ansible_vars["ENV_LIST"] = "prod,dev,test";
-            $this->_ansible_vars["API_CIDR"] = "172.20.0.0/24";
+	        $this->_ansible_vars["API_CIDR"] = "172.20.0.0/24";
             $this->_ansible_vars["MYSQL_ROOT_PASSWORD"] = $this->_mysql_root_pass;
 
             $this->_add_nginx_links = (boolean)$input->getOption('add-nginx-links');
@@ -354,9 +355,11 @@ class Release extends Command
             foreach ($depends as $depend) {
                 if (in_array($depend, $modules)) {
                     return true;
-                }
             }
         }
+        return $resp;
+    }
+
         return false;
     }
 
@@ -386,10 +389,14 @@ class Release extends Command
                     if ($helper->ask($input, $output, $question)) {
                         $modules [] = $name;
                         $value['REQUIRED'] = true;
-                    }
-                }
-            }
-        }
+    }
+
+    }
+
+    }
+
+    }
+
         $modules = implode(",", $modules);
         return $modules;
     }
@@ -403,8 +410,10 @@ class Release extends Command
         foreach ($this->_modules as $key => $values) {
             if ($values['HOST_ENV']) {
                 $resp ["HOST_" . strtoupper($key)] = $this->getDomain($key);
-            }
-        }
+    }
+
+    }
+
         return $resp;
     }
 
@@ -429,6 +438,7 @@ class Release extends Command
             "host_env_file" => $host_env_file,
             "registry" => $registry);
 
+
         /**************************************************************************************/
         /* Apps / Web UI / PMA */
         /**************************************************************************************/
@@ -441,6 +451,7 @@ class Release extends Command
             $object->add($this, $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
@@ -518,7 +529,7 @@ class Release extends Command
                     foreach ($app['VAR_ENV'] as $key => $value) {
                         if ($key == 'VIRTUAL_HOST') {
                             $env .= "VIRTUAL_HOST=" . $this->getDomain($module) . "\n";
-                        } else if ($key == 'PMA_ABSOLUTE_URI') {
+                        } else if($key == 'PMA_ABSOLUTE_URI') {
                             $env .= "PMA_ABSOLUTE_URI=" . $this->getDomain("pma") . "\n";
                         } else {
                             $env .= $key . "=" . $value . "\n";

+ 2 - 1
tools/src/Services/Ftth_tasklogger_worker.php

@@ -49,7 +49,8 @@ class Ftth_tasklogger_worker extends InitialService
                 ->addEnviroment("AMQP_KEY", "$initial")
                 ->addVolumes("./$initial/", "/opt/$initial")
                 ->addVolumes("./extra/netmiko", "/opt/netmiko")
+                ->addVolumes("./extra/supervisord/bin/connect", "/usr/bin/connect")
                 ->addVolumes("./extra/backups-config", "/opt/ftth/web/backups-config");
         }
     }
-}
+}

+ 3 - 1
tools/src/Services/Tftp.php

@@ -41,8 +41,10 @@ class Tftp extends InitialService
                 ->addEnv_file($host_env_file)
                 ->restart($release->_docker_restart_default)
                 ->addPorts(69, '69/udp')
+                ->addPorts(37, '37')
+                ->addPorts(123, '123/udp')
                 ->addVolumes("/tftpboot", "/tftpboot");
         }
     }
 
-}
+}