|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace FD3;
|
|
namespace FD3;
|
|
|
|
|
|
|
|
+use function GuzzleHttp\default_user_agent;
|
|
use Symfony\Component\Console\Command\Command;
|
|
use Symfony\Component\Console\Command\Command;
|
|
use Symfony\Component\Console\Input\InputInterface;
|
|
use Symfony\Component\Console\Input\InputInterface;
|
|
use Symfony\Component\Console\Input\InputArgument;
|
|
use Symfony\Component\Console\Input\InputArgument;
|
|
@@ -198,7 +199,7 @@ class Release extends Command
|
|
}
|
|
}
|
|
if (file_exists($dir . "/" . $this->_running_log)) {
|
|
if (file_exists($dir . "/" . $this->_running_log)) {
|
|
$helper = $this->getHelper('question');
|
|
$helper = $this->getHelper('question');
|
|
- $question = new ConfirmationQuestion('The ' . $this->_running_log . ' file exist. Read file or take parameters? (Y/n)', true);
|
|
|
|
|
|
+ $question = new ConfirmationQuestion('The ' . realpath($dir) . "/" . $this->_running_log . ' file exist. Read file or take parameters? (Y/n)', true);
|
|
if ($helper->ask($input, $output, $question)) {
|
|
if ($helper->ask($input, $output, $question)) {
|
|
$this->setParametersFormFile($input);
|
|
$this->setParametersFormFile($input);
|
|
}
|
|
}
|
|
@@ -208,14 +209,14 @@ class Release extends Command
|
|
|
|
|
|
$this->_ansible_vars["DOMAIN"] = $this->_domain;
|
|
$this->_ansible_vars["DOMAIN"] = $this->_domain;
|
|
|
|
|
|
- $dObj = new DevOps\FileSystem($dir);
|
|
|
|
|
|
+ $dObj = new DevOps\FileSystem(realpath($dir));
|
|
$dObj->dirExists()->realpath();
|
|
$dObj->dirExists()->realpath();
|
|
$this->_dObj = $dObj;
|
|
$this->_dObj = $dObj;
|
|
|
|
|
|
// agrego las opciones del input a la configuracion _modues
|
|
// agrego las opciones del input a la configuracion _modues
|
|
$this->addConfigOptions($input);
|
|
$this->addConfigOptions($input);
|
|
// creo el archivo de log de como se ejecuto
|
|
// creo el archivo de log de como se ejecuto
|
|
- $this->createFileRunning($input);
|
|
|
|
|
|
+ $this->createFileRunning($input, $output);
|
|
// cargo las fuentes a clonar
|
|
// cargo las fuentes a clonar
|
|
$this->createGitClone();
|
|
$this->createGitClone();
|
|
// creo el archivo docker-compose.yml
|
|
// creo el archivo docker-compose.yml
|
|
@@ -243,6 +244,8 @@ class Release extends Command
|
|
"[defaults]\n" .
|
|
"[defaults]\n" .
|
|
"inventory=inventory.ini\n"
|
|
"inventory=inventory.ini\n"
|
|
);
|
|
);
|
|
|
|
+ // copio el playbook
|
|
|
|
+ copy(getcwd() . "/playbook.yml", $dObj->dirExists()->realpath()->getPath() . "/playbook.yml");
|
|
} catch (\Throwable $error) {
|
|
} catch (\Throwable $error) {
|
|
var_dump($error->getTraceAsString(), $error->getCode(), $error->getMessage());
|
|
var_dump($error->getTraceAsString(), $error->getCode(), $error->getMessage());
|
|
} finally {
|
|
} finally {
|
|
@@ -690,13 +693,15 @@ class Release extends Command
|
|
/**
|
|
/**
|
|
* Crea un archivo conlos parametros con los que se corrio el script.
|
|
* Crea un archivo conlos parametros con los que se corrio el script.
|
|
* @param InputInterface $input Contiene el input
|
|
* @param InputInterface $input Contiene el input
|
|
|
|
+ * @param OutputInterface $output Contiene el output
|
|
*/
|
|
*/
|
|
- private function createFileRunning(InputInterface $input)
|
|
|
|
|
|
+ private function createFileRunning(InputInterface $input, OutputInterface $output)
|
|
{
|
|
{
|
|
$file = array();
|
|
$file = array();
|
|
$file ["Running"] = array("date" => gmdate('Y-m-d h:i:s'));
|
|
$file ["Running"] = array("date" => gmdate('Y-m-d h:i:s'));
|
|
$file ["Arguments"] = $input->getArguments();
|
|
$file ["Arguments"] = $input->getArguments();
|
|
$file ["Options"] = $input->getOptions();
|
|
$file ["Options"] = $input->getOptions();
|
|
|
|
+ $output->writeln("Writing " . $this->_dObj->getPath() . "/" . $this->_running_log);
|
|
$this->_dObj->file($this->_running_log)->writeIniConfig($file);
|
|
$this->_dObj->file($this->_running_log)->writeIniConfig($file);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -857,6 +862,6 @@ class Release extends Command
|
|
$all .= $this->_domain . "_" . $key . "_1\n";
|
|
$all .= $this->_domain . "_" . $key . "_1\n";
|
|
}
|
|
}
|
|
|
|
|
|
- $this->_dObj->file("inventory111.ini")->content($tmp . $all);
|
|
|
|
|
|
+ $this->_dObj->file("inventory.ini")->content($tmp . $all);
|
|
}
|
|
}
|
|
}
|
|
}
|