Я пытаюсь запустить svn commit на сервере, такой же коммит работает на моем vm, но когда на сервере я получаю следующее:
svn: E070014: не удается подключиться к хранилищу по URL ' https://svnrepo....../path/to/file.xml '
svn: E070014: Невозможно прочитать стандартный ввод: Конец файла найден.
Этот код работает на моем виртуальном компьютере, но не на сервере
public function runCommit($username,$password,$comment="")
{
$error = '';
$comComment = strlen(trim($comment)) > 1 ? $comment: "changes/delete committed";
$location = $this->fileHelper->getStorageRoot();
$gitLocation = env('SVN_REPO');
$splitted = explode('//',$gitLocation);
$gitBuild = "";
$svnBuild = "--username $username --password $password";
if(count($splitted) > 1){// splitted
$gitBuild = $splitted[0]."//".$username.":".$password."@".$splitted[1];
}
$deleted = $this->fileHelper->getFromSvnForDeleted();
$updated = $this->fileHelper->getFromSvnForUpdate();
$addFiles = "";
if(!empty($updated) && count($updated)){
$addFiles = implode(" ",$updated);
}
$deleted_files = $deleted ? $deleted : [];
// git first
$gitprocesses = [
[
"name"=> "Add files", 'command'=>new Process("git add $addFiles"),'error'=>'no files to add'
],
[
"name"=> "Commit", 'command'=>new Process("git commit $addFiles -m '$comComment'"),'error'=>'Warning no files to commit'
],
[
"name"=> "Push", 'command'=>new Process("git push $gitBuild "),'error'=>'Unable to push invalid password/user'
],
];
$svnProcesses = [
//["name"=> "Testing exec", 'command'=>new Process("echo 'testin entry' >> test.txt"),'error'=>'Warning: file add failed']
];
if(strlen($addFiles) > 5){
$svnProcesses[] =[
"name"=> "Add files", 'command'=>new Process("svn add $addFiles $svnBuild"),'error'=>'Warning: file add failed'
];
}
if(!empty($deleted_files)){
foreach($deleted_files as $file){
$command = [
"name"=> "Delete File", 'command'=> new Process("svn delete $file $svnBuild"),"error" =>"Warning: error deleting $file"
];
$svnProcesses[] = $command;
}
}
$svnProcesses[] = [
"name"=> "Commit", 'command'=>new Process("svn commit -m '".$comComment."' $addFiles"." $svnBuild"),'error'=>'Error commiting files invalid username/password'
];
$bigProcesses = $svnProcesses;
if($this->isGit){
$bigProcesses = $gitprocesses;
}
foreach($bigProcesses as $aProcess){
$process = $aProcess['command'];
$name = $aProcess['name'];
$errorM = $aProcess['error'];
//log::debug($aProcess);
$process->setWorkingDirectory($location);
try{
$this->runProcess($process);
if($name=='Delete file'){// empty deletes
$this->fileHelper->resetSvnDeletedFiles();
}
$errorResult['status'] = true;
$errorResult['message']='Changes have been committed successfully';
}catch(\Exception $e){
$error = "process $name failed -->".$e->getMessage();//$process->getOutPut();
$errorResult['message'] = $errorM;
$errorResult['status'] = false;
log::error($error);
}
}
if($errorResult['status']){
$this->fileHelper->resetSvnUpdateFiles();
}
return $errorResult;
}
public function runProcess($process)
{
$process->run();
if($process->isSuccessful()){
return true;
}else{
throw new ProcessFailedException($process);
}
}