1
0
mirror of https://github.com/hauke68/Magallanes.git synced 2025-09-13 12:40:18 +02:00

git local commands should be executed in the deployment:from directory

This commit is contained in:
Jérémy Huet 2014-12-13 15:14:43 +01:00
parent e453d1977d
commit a58dcbe766
2 changed files with 5 additions and 3 deletions

View File

@ -63,14 +63,15 @@ class ChangeBranchTask extends AbstractTask
*/ */
public function run() public function run()
{ {
$preCommand = 'cd ' . $this->getConfig()->deployment('from', './') . '; ';
switch ($this->getConfig()->general('scm')) { switch ($this->getConfig()->general('scm')) {
case 'git': case 'git':
if ($this->getParameter('_changeBranchRevert', false)) { if ($this->getParameter('_changeBranchRevert', false)) {
$command = 'git checkout ' . self::$startingBranch; $command = $preCommand . 'git checkout ' . self::$startingBranch;
$result = $this->runCommandLocal($command); $result = $this->runCommandLocal($command);
} else { } else {
$command = 'git branch | grep \'*\' | cut -d\' \' -f 2'; $command = $preCommand . 'git branch | grep \'*\' | cut -d\' \' -f 2';
$currentBranch = 'master'; $currentBranch = 'master';
$result = $this->runCommandLocal($command, $currentBranch); $result = $this->runCommandLocal($command, $currentBranch);

View File

@ -54,9 +54,10 @@ class UpdateTask extends AbstractTask
*/ */
public function run() public function run()
{ {
$command = 'cd ' . $this->getConfig()->deployment('from', './') . '; ';
switch ($this->getConfig()->general('scm')) { switch ($this->getConfig()->general('scm')) {
case 'git': case 'git':
$command = 'git pull'; $command .= 'git pull';
break; break;
default: default: