|
@@ -77,7 +77,7 @@ class Release extends Command
|
|
|
private $_user_system;
|
|
|
|
|
|
/**
|
|
|
- * @var string $directory Directorio de instalación
|
|
|
+ * @var string $directory Directorio de instalación
|
|
|
*/
|
|
|
private $directory;
|
|
|
|
|
@@ -243,12 +243,28 @@ class Release extends Command
|
|
|
->addOption('client', null, InputOption::VALUE_REQUIRED, 'Client name, if is not provided uses, the dirname of the installation', false)
|
|
|
->addOption('modules', null, InputOption::VALUE_REQUIRED, 'List of modules to install separated by coma.', "all")
|
|
|
->addOption('inventory', null, InputOption::VALUE_REQUIRED, 'Write inventory.ini by default.', true)
|
|
|
- ->addOption('docker-tag', null, InputOption::VALUE_REQUIRED, 'Docker tag to be used', "latest");
|
|
|
+ ->addOption('docker-tag', null, InputOption::VALUE_REQUIRED, 'Docker tag to be used', "latest")
|
|
|
+ ->addOption('all-ref', null, InputOption::VALUE_REQUIRED, 'Git reference (branch or tag) to clone all app', "")
|
|
|
+ ->addOption('general-version', null, InputOption::VALUE_REQUIRED, 'Set options all-ref and docker-tag with this value. Ej. 0.1.1', "");
|
|
|
}
|
|
|
|
|
|
protected function execute(InputInterface $input, OutputInterface $output)
|
|
|
{
|
|
|
try {
|
|
|
+ if (strlen(trim($input->getOption("general-version"))) > 0) {
|
|
|
+ $input->setOption('all-ref', 'v' . $input->getOption('general-version'));
|
|
|
+ $input->setOption('docker-tag', $input->getOption('general-version'));
|
|
|
+ }
|
|
|
+ if (strlen(trim($input->getOption("all-ref"))) > 0) {
|
|
|
+ $input->setOption('base-ref', $input->getOption('all-ref'));
|
|
|
+ $input->setOption('ftth-ref', $input->getOption('all-ref'));
|
|
|
+ $input->setOption('mapas-ref', $input->getOption('all-ref'));
|
|
|
+ $input->setOption('radius-ref', $input->getOption('all-ref'));
|
|
|
+ $input->setOption('stats-ref', $input->getOption('all-ref'));
|
|
|
+ $input->setOption('cablemodem-ref', $input->getOption('all-ref'));
|
|
|
+ $input->setOption('dhcp-ref', $input->getOption('all-ref'));
|
|
|
+ $input->setOption('extra-ref', $input->getOption('all-ref'));
|
|
|
+ }
|
|
|
if (strtolower($input->getOption("modules")) == "all") {
|
|
|
// seteo todos los modulos a instalar por defecto
|
|
|
$modules = "";
|
|
@@ -499,6 +515,28 @@ class Release extends Command
|
|
|
$this->writeVariablesEnviroment($module . "." . $host_env_file, $module);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * atftp, tod
|
|
|
+ *
|
|
|
+ * @param FileFormat2 $composer
|
|
|
+ * @param array $config
|
|
|
+ */
|
|
|
+ function addTftp(FileFormat2 $composer, $config = array())
|
|
|
+ {
|
|
|
+ $version = "latest";
|
|
|
+ $registry = "";
|
|
|
+ $host_env_file = "";
|
|
|
+ extract($config);
|
|
|
+
|
|
|
+ $composer
|
|
|
+ ->addService("tftp")
|
|
|
+ ->build("extra/tftp/")
|
|
|
+ ->image($registry . "fd3/tftp:" . $version)
|
|
|
+ ->addEnv_file($host_env_file)
|
|
|
+ ->restart($this->_docker_restart_default)
|
|
|
+ ->addPorts(69, 69);
|
|
|
+ }
|
|
|
+
|
|
|
function addRadius(FileFormat2 $composer, $config = array())
|
|
|
{
|
|
|
$module = "radius";
|
|
@@ -627,7 +665,8 @@ class Release extends Command
|
|
|
->image($registry . "fd3/$module:" . $version)
|
|
|
->build("./extra/mysql")
|
|
|
->addEnv_file($module . "." . $host_env_file)
|
|
|
- ->addVolumes("./mysql/", "/var/lib/mysql/");
|
|
|
+ ->addVolumes("./mysql/", "/var/lib/mysql/")
|
|
|
+ ->addVolumes("./extra/mysql/fd3.conf", "/etc/mysql/conf.d/fd3.conf");
|
|
|
$this->writeVariablesEnviroment($module . "." . $host_env_file, $module,
|
|
|
array(
|
|
|
"MYSQL_ROOT_PASSWORD" => $this->_mysql_root_pass,
|
|
@@ -952,6 +991,8 @@ class Release extends Command
|
|
|
$this->addSupervisord($composer, $base_vars);
|
|
|
$this->addCommandWorkers($composer, $base_vars);
|
|
|
|
|
|
+ $this->addTftp($composer, $base_vars);
|
|
|
+
|
|
|
// Geoserver
|
|
|
$this->addGeoserver($composer, $base_vars);
|
|
|
|