|
@@ -76,6 +76,11 @@ class Release extends Command
|
|
|
*/
|
|
|
private $_user_system;
|
|
|
|
|
|
+ /**
|
|
|
+ * @var string $directory Directorio de instalación
|
|
|
+ */
|
|
|
+ private $directory;
|
|
|
+
|
|
|
/**
|
|
|
* Constructor.
|
|
|
*
|
|
@@ -242,13 +247,13 @@ class Release extends Command
|
|
|
$input->setOption("modules", $modules);
|
|
|
}
|
|
|
$this->AddModules(explode(",", $input->getOption("modules")));
|
|
|
- $dir = $input->getArgument('dir');
|
|
|
- if (!is_dir($dir)) {
|
|
|
- mkdir($dir, 0777, true);
|
|
|
+ $this->directory = $input->getArgument('dir');
|
|
|
+ if (!is_dir($this->directory)) {
|
|
|
+ mkdir($this->directory, 0777, true);
|
|
|
}
|
|
|
- if (file_exists($dir . "/" . $this->_running_log)) {
|
|
|
+ if (file_exists($this->directory . "/" . $this->_running_log)) {
|
|
|
$helper = $this->getHelper('question');
|
|
|
- $question = new ConfirmationQuestion('The ' . realpath($dir) . "/" . $this->_running_log . ' file exist. Read file or take parameters? (Y/n)', true);
|
|
|
+ $question = new ConfirmationQuestion('The ' . realpath($this->directory) . "/" . $this->_running_log . ' file exist. Read file or take parameters? (Y/n)', true);
|
|
|
if ($helper->ask($input, $output, $question)) {
|
|
|
$this->setParametersFormFile($input);
|
|
|
}
|
|
@@ -257,19 +262,19 @@ class Release extends Command
|
|
|
$this->_client = $input->getOption("client");
|
|
|
|
|
|
if (!$this->_client) {
|
|
|
- $this->_client = basename(realpath($dir));
|
|
|
+ $this->_client = basename(realpath($this->directory));
|
|
|
}
|
|
|
|
|
|
$docker_tag = $input->getOption("docker-tag");
|
|
|
|
|
|
- $this->internal_user_id = 2;
|
|
|
+ $this->internal_user_id = 2;
|
|
|
|
|
|
$this->_ansible_vars["DOMAIN"] = $this->_domain;
|
|
|
$this->_ansible_vars["CLIENT"] = $this->_client;
|
|
|
$this->_ansible_vars["CMD_USERNAME"] = $this->_user_system['users'][$this->internal_user_id]['user'];
|
|
|
$this->_ansible_vars["CMD_PASSWORD"] = $this->_user_system['users'][$this->internal_user_id]['password'];
|
|
|
|
|
|
- $dObj = new DevOps\FileSystem(realpath($dir));
|
|
|
+ $dObj = new DevOps\FileSystem(realpath($this->directory));
|
|
|
$dObj->dirExists()->realpath();
|
|
|
$this->_dObj = $dObj;
|
|
|
|
|
@@ -294,7 +299,7 @@ class Release extends Command
|
|
|
|
|
|
$dObj->file('install.yml')->content(
|
|
|
yaml::dump(array(
|
|
|
- "install_dir" => realpath($dir),
|
|
|
+ "install_dir" => realpath($this->directory),
|
|
|
'docker_apps' => "base," . implode(",", $this->_ansible_vars),
|
|
|
'domain' => $this->_domain,
|
|
|
)
|
|
@@ -1081,10 +1086,11 @@ class Release extends Command
|
|
|
{
|
|
|
$tmp = "";
|
|
|
$all = "[all]\n";
|
|
|
+ $prefix = basename(realpath($this->directory));
|
|
|
foreach ($composer->getServices() as $key => $value) {
|
|
|
$tmp .= "[$key]\n";
|
|
|
- $tmp .= $this->_client . "_" . $key . "_1\n\n";
|
|
|
- $all .= $this->_client . "_" . $key . "_1\n";
|
|
|
+ $tmp .= $prefix . "_" . $key . "_1\n\n";
|
|
|
+ $all .= $prefix . "_" . $key . "_1\n";
|
|
|
}
|
|
|
|
|
|
$this->_dObj->file("inventory.ini")->content($tmp . $all);
|