This commit is contained in:
Bozhidar 2024-10-01 11:43:56 +03:00
parent 6ae9e2eb62
commit c537046640
2 changed files with 5 additions and 5 deletions

View file

@ -86,8 +86,8 @@ class GitRepository extends Model
shell_exec('mkdir -p ' . $sshPath);
}
shell_exec('chown '.$findHostingSubscription->system_username.':'.$findHostingSubscription->system_username.' -R ' . dirname($sshPath));
shell_exec('chmod 0700 ' . dirname($sshPath));
shell_exec('chown '.$findHostingSubscription->system_username.':'.$findHostingSubscription->system_username.' -R ' . $sshPath);
shell_exec('chmod 0700 ' . $sshPath);
if (!file_exists($privateKeyFile)) {
file_put_contents($privateKeyFile, $gitSSHKey->private_key);
@ -156,7 +156,7 @@ class GitRepository extends Model
shell_exec('mkdir -p ' . dirname($shellFile));
shell_exec('chown '.$findHostingSubscription->system_username.':'.$findHostingSubscription->system_username.' -R ' . dirname(dirname($shellFile)));
$shellContent = view('actions.git.pull-repo', [
$shellContent = view('actions.git.pull-repo-user', [
'gitProvider' => $gitSSHUrl['provider'],
'systemUsername' => $findHostingSubscription->system_username,
'gitRepositoryId' => $this->id,

View file

@ -2,6 +2,8 @@ echo "Pull started at {{ date('Y-m-d H:i:s') }}"
cd {{$projectDir}}
git reset --hard
@if($privateKeyFile)
ssh-keyscan {{$gitProvider}} >> /home/{{$systemUsername}}/.ssh/known_hosts
@ -17,5 +19,3 @@ git pull
@endif
rm -rf {{$selfFile}}
curl