Finally fixed project directory for Build::writeSshKey and
Build::writeSshWrapper (Now files in system temp directory). Issue #165.
This commit is contained in:
parent
7747193c89
commit
55bebf05dc
|
@ -472,13 +472,11 @@ class Build extends BaseBuild
|
|||
*/
|
||||
protected function writeSshKey($cloneTo)
|
||||
{
|
||||
$keyPath = $cloneTo . 'temp';
|
||||
$keyFile = $keyPath . '.key';
|
||||
$tempKeyFile = tempnam(sys_get_temp_dir(), 'key_');
|
||||
|
||||
file_put_contents($keyFile, $this->getProject()->getSshPrivateKey());
|
||||
chmod($keyFile, 0600);
|
||||
file_put_contents($tempKeyFile, $this->getProject()->getSshPrivateKey());
|
||||
|
||||
return $keyFile;
|
||||
return $tempKeyFile;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -491,9 +489,6 @@ class Build extends BaseBuild
|
|||
*/
|
||||
protected function writeSshWrapper($cloneTo, $keyFile)
|
||||
{
|
||||
$path = $cloneTo . 'temp';
|
||||
$wrapperFile = $path . '.sh';
|
||||
|
||||
$sshFlags = '-o CheckHostIP=no -o IdentitiesOnly=yes -o StrictHostKeyChecking=no -o PasswordAuthentication=no';
|
||||
|
||||
// Write out the wrapper script for this build:
|
||||
|
@ -502,11 +497,12 @@ class Build extends BaseBuild
|
|||
ssh {$sshFlags} -o IdentityFile={$keyFile} $*
|
||||
|
||||
OUT;
|
||||
$tempShFile = tempnam(sys_get_temp_dir(), 'sh_');
|
||||
|
||||
file_put_contents($wrapperFile, $script);
|
||||
shell_exec('chmod +x "' . $wrapperFile . '"');
|
||||
file_put_contents($tempShFile, $script);
|
||||
shell_exec('chmod +x "' . $tempShFile . '"');
|
||||
|
||||
return $wrapperFile;
|
||||
return $tempShFile;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -99,7 +99,7 @@ class PhpCpd extends Plugin implements ZeroConfigPluginInterface
|
|||
|
||||
$phpcpd = $this->findBinary('phpcpd');
|
||||
|
||||
$tmpFileName = tempnam('/tmp', 'phpcpd');
|
||||
$tmpFileName = tempnam(sys_get_temp_dir(), 'phpcpd_');
|
||||
|
||||
$cmd = $phpcpd . ' --log-pmd "%s" %s "%s"';
|
||||
$success = $this->builder->executeCommand($cmd, $tmpFileName, $ignore, $this->path);
|
||||
|
|
|
@ -161,7 +161,7 @@ class PhpUnit extends Plugin implements ZeroConfigPluginInterface
|
|||
$buildPath = $this->build->getBuildPath();
|
||||
|
||||
// Save the results into a log file
|
||||
$logFile = @tempnam($buildPath, 'jLog_');
|
||||
$logFile = tempnam(sys_get_temp_dir(), 'jlog_');
|
||||
$options->addArgument('log-' . $logFormat, $logFile);
|
||||
|
||||
// Removes any current configurations files
|
||||
|
@ -258,7 +258,7 @@ class PhpUnit extends Plugin implements ZeroConfigPluginInterface
|
|||
$this->builder, 'php_unit', $error['message'], $severity, $error['file'], $error['line']
|
||||
);
|
||||
}
|
||||
@unlink($logFile);
|
||||
unlink($logFile);
|
||||
} else {
|
||||
throw new \Exception('log output file does not exist: ' . $logFile);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue