|
@@ -60,8 +60,6 @@ class TagModulesCommand extends Command
|
|
|
$git->config->add('user.name', 'drone', ["global" => true]);
|
|
|
// agrego el path del repositorio
|
|
|
$git->setRepository($git_path);
|
|
|
- // guardo cualquier cambio anterior.
|
|
|
- $git->stash();
|
|
|
// necesito traer todos los branch's para ver si ya existe
|
|
|
$branchs = $git->branch(['all' => true]);
|
|
|
$findBranch = false;
|
|
@@ -76,19 +74,25 @@ class TagModulesCommand extends Command
|
|
|
}
|
|
|
if (!$findBranch) {
|
|
|
// si no existe el branch y estoy creando un branch nuevo
|
|
|
+ $output->writeln('Creando la rama ' . $version);
|
|
|
$git->branch->create($version);
|
|
|
}
|
|
|
// cambio a la rama de la version y agrego los archivos modificados
|
|
|
+ $output->writeln('Checkout de la rama ' . $version);
|
|
|
$git->checkout($version);
|
|
|
$git->add('composer.json');
|
|
|
$git->add('composer.lock');
|
|
|
|
|
|
+ $output->writeln('Push de los composer');
|
|
|
+ $output->writeln('\t' . $cd_path . "; git commit -am 'Composer para la version " . $version . " y el tag " . $tag . "'");
|
|
|
shell_exec($cd_path . "; git commit -am 'Composer para la version " . $version . " y el tag " . $tag . "'");
|
|
|
+ $output->writeln('\t' . "; git push " . $optionRemoteGit . " " . $version);
|
|
|
shell_exec($cd_path . "; git push " . $optionRemoteGit . " " . $version );
|
|
|
// estoy creando un tag
|
|
|
$tags = $git->tag();
|
|
|
if (!in_array($tag, $tags)) {
|
|
|
// el tag no existe
|
|
|
+ $output->writeln('Creo el tag: ' . $tag);
|
|
|
if ($branchRemote == null) {
|
|
|
// el branch remote no existe
|
|
|
$git->tag->create($tag, $version);
|
|
@@ -98,6 +102,9 @@ class TagModulesCommand extends Command
|
|
|
}
|
|
|
}
|
|
|
// ejecuto el comando git
|
|
|
+ $output->writeln('Push de la rama.');
|
|
|
+ $output->writeln('\t' . "; git push " . $optionRemoteGit . " --tags ");
|
|
|
+ // tengo que hacer el --tags para que pase todos los tags
|
|
|
shell_exec($cd_path . "; git push " . $optionRemoteGit . " --tags ");
|
|
|
} catch (GitException $e) {
|
|
|
$output->writeln("SE PRODUJO UN ERROR EN " . $sec);
|