Browse Source

Merge pull request #365 from nolotz/nostromo

[FEATURE] Adds from paramter for rsync and tar tasks
pull/1/head
Andrés Montañez 8 years ago committed by GitHub
parent
commit
0d3c595b18
  1. 1
      docs/example-config.yml
  2. 3
      src/Task/BuiltIn/Deploy/RsyncTask.php
  3. 3
      src/Task/BuiltIn/Deploy/Tar/PrepareTask.php

1
docs/example-config.yml

@ -3,6 +3,7 @@ magephp:
production: production:
user: app user: app
branch: test branch: test
from: ./
host_path: /var/www/test host_path: /var/www/test
releases: 4 releases: 4
exclude: exclude:

3
src/Task/BuiltIn/Deploy/RsyncTask.php

@ -45,7 +45,8 @@ class RsyncTask extends AbstractTask
} }
$excludes = $this->getExcludes(); $excludes = $this->getExcludes();
$cmdRsync = sprintf('rsync -e "ssh -p %d %s" %s %s ./ %s@%s:%s', $sshConfig['port'], $sshConfig['flags'], $flags, $excludes, $user, $host, $targetDir); $from = $this->runtime->getEnvOption('from', './');
$cmdRsync = sprintf('rsync -e "ssh -p %d %s" %s %s %s %s@%s:%s', $sshConfig['port'], $sshConfig['flags'], $flags, $excludes, $from, $user, $host, $targetDir);
/** @var Process $process */ /** @var Process $process */
$process = $this->runtime->runLocalCommand($cmdRsync, 600); $process = $this->runtime->runLocalCommand($cmdRsync, 600);

3
src/Task/BuiltIn/Deploy/Tar/PrepareTask.php

@ -42,7 +42,8 @@ class PrepareTask extends AbstractTask
$excludes = $this->getExcludes(); $excludes = $this->getExcludes();
$flags = $this->runtime->getEnvOption('tar_create', 'cfzp'); $flags = $this->runtime->getEnvOption('tar_create', 'cfzp');
$cmdTar = sprintf('tar %s %s %s ./', $flags, $tarLocal, $excludes); $from = $this->runtime->getEnvOption('from', './');
$cmdTar = sprintf('tar %s %s %s %s', $flags, $tarLocal, $excludes, $from);
/** @var Process $process */ /** @var Process $process */
$process = $this->runtime->runLocalCommand($cmdTar, 300); $process = $this->runtime->runLocalCommand($cmdTar, 300);

Loading…
Cancel
Save