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