Pārlūkot izejas kodu

Se agregaron las opciones 'all-ref' y 'general-version'.
all-ref se utiliza para los branchs de los módulos. Esta opción pisa '*-ref'.
general-version se utiliza para las imagenes de los docker y las versiones de los módulos. Esta opción pisa 'docker-tag' y 'all-ref'.

Gabriel Gosparo 7 gadi atpakaļ
vecāks
revīzija
975c4bc040
1 mainītis faili ar 18 papildinājumiem un 2 dzēšanām
  1. 18 2
      tools/src/Release.php

+ 18 - 2
tools/src/Release.php

@@ -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 = "";