/** * Main deploy method * @return string commands output */ public function deploy() { $this->output->writeln("Copy code to the next release dir"); $this->remoteCopyRecursive($this->target->get('deploy.current_release_dir') . '/.', $this->target->get('deploy.next_release_dir')); $out = $this->sshClient->getLastOutput(); $this->output->writeln("Sync code to the next release"); $this->rsync($this->target->getFixedPath('deploy.local_base_dir'), $this->target->get('deploy.dry_run') ? $this->target->get('deploy.current_release_dir') . '/' : $this->target->get('deploy.next_release_dir')); $out .= $this->sshClient->getLastOutput(); return $out; }
public function testConnect() { $sshClient = new SshClient(new FakeSsh2Proxy($this)); $sshClient->setParameters($this->params); $sshClient->setHost('localhost'); $sshClient->connect(); $this->assertEquals('text', $sshClient->exec('text')); $this->assertEquals('test out text', $sshClient->getLastOutput()); $this->assertEquals('test err text', $sshClient->getLastError()); $this->assertEquals('test', $sshClient->getUser()); $this->assertEquals('23', $sshClient->getPort()); $this->assertEquals('localhost', $sshClient->getHost()); $sshClient->setHost('host'); $this->assertEquals('host', $sshClient->getHost()); }