From c537046640ea8429ad95de04f740f73626301622 Mon Sep 17 00:00:00 2001 From: Bozhidar Date: Tue, 1 Oct 2024 11:43:56 +0300 Subject: [PATCH] update --- web/app/Models/GitRepository.php | 6 +++--- web/resources/views/actions/git/pull-repo-user.blade.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/web/app/Models/GitRepository.php b/web/app/Models/GitRepository.php index 86f6a6d..7da4345 100644 --- a/web/app/Models/GitRepository.php +++ b/web/app/Models/GitRepository.php @@ -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, diff --git a/web/resources/views/actions/git/pull-repo-user.blade.php b/web/resources/views/actions/git/pull-repo-user.blade.php index 958da07..0744a3f 100644 --- a/web/resources/views/actions/git/pull-repo-user.blade.php +++ b/web/resources/views/actions/git/pull-repo-user.blade.php @@ -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