protected function _copyPackageToServer($remoteHost, Project $project, TaskModel $task)
{
$version = $task->link_id;
$packagePath = Project::getDeployPackagePath($version);
$releasePackage = Project::getReleaseVersionPackage($version);
$scpCommand = sprintf('scp -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o CheckHostIP=false -P %d %s %s@%s:%s', $this->getHostPort($remoteHost), $packagePath, escapeshellarg($this->getConfig()->release_user), escapeshellarg($this->getHostName($remoteHost)), $releasePackage);
$ret = $this->runLocalCommand($scpCommand);
if (!$ret) {
throw new \Exception(yii::t('walle', 'rsync error'));
}
return true;
}