From e4296345b3f5604a14b8a25229761ebf807e8050 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Sun, 1 Oct 2023 12:29:50 +0200 Subject: [PATCH] fix: public repo branch selection fix: commit sha selection in source tabs --- .../Livewire/Project/New/PublicGitRepository.php | 12 +++++------- app/Jobs/ApplicationDeploymentJob.php | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/Http/Livewire/Project/New/PublicGitRepository.php b/app/Http/Livewire/Project/New/PublicGitRepository.php index 4aee4c3bf..837c32abe 100644 --- a/app/Http/Livewire/Project/New/PublicGitRepository.php +++ b/app/Http/Livewire/Project/New/PublicGitRepository.php @@ -26,6 +26,10 @@ class PublicGitRepository extends Component public string $git_branch = 'main'; public int $rate_limit_remaining = 0; public $rate_limit_reset = 0; + private object $repository_url_parsed; + public GithubApp|GitlabApp|null $git_source = null; + public string $git_host; + public string $git_repository; protected $rules = [ 'repository_url' => 'required|url', 'port' => 'required|numeric', @@ -38,10 +42,6 @@ class PublicGitRepository extends Component 'is_static' => 'static', 'publish_directory' => 'publish directory', ]; - private object $repository_url_parsed; - private GithubApp|GitlabApp|null $git_source = null; - private string $git_host; - private string $git_repository; public function mount() { @@ -76,6 +76,7 @@ class PublicGitRepository extends Component $this->get_branch(); $this->selected_branch = $this->git_branch; } catch (\Throwable $e) { + ray($e->getMessage()); if (!$this->branch_found && $this->git_branch == 'main') { try { $this->git_branch = 'master'; @@ -123,9 +124,6 @@ class PublicGitRepository extends Component $project_uuid = $this->parameters['project_uuid']; $environment_name = $this->parameters['environment_name']; - $this->get_git_source(); - $this->git_branch = $this->selected_branch ?? $this->git_branch; - $destination = StandaloneDocker::where('uuid', $destination_uuid)->first(); if (!$destination) { $destination = SwarmDocker::where('uuid', $destination_uuid)->first(); diff --git a/app/Jobs/ApplicationDeploymentJob.php b/app/Jobs/ApplicationDeploymentJob.php index 3ae8b4214..69d385445 100644 --- a/app/Jobs/ApplicationDeploymentJob.php +++ b/app/Jobs/ApplicationDeploymentJob.php @@ -167,7 +167,6 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted "hidden" => true, ] ); - $this->next(ApplicationDeploymentStatus::FAILED->value); } } private function deploy_docker_compose() @@ -402,7 +401,7 @@ class ApplicationDeploymentJob implements ShouldQueue, ShouldBeEncrypted { $this->execute_remote_command( [ - "echo -n 'Importing {$this->application->git_repository}:{$this->application->git_branch} to {$this->workdir}. '" + "echo -n 'Importing {$this->application->git_repository}:{$this->application->git_branch} (commit sha {$this->application->git_commit_sha}) to {$this->workdir}. '" ], [ $this->importing_git_repository() @@ -799,5 +798,6 @@ COPY ./nginx.conf /etc/nginx/conf.d/default.conf"); ["echo 'Oops something is not okay, are you okay? 😢'"], ["echo '{$exception->getMessage()}'"] ); + $this->next(ApplicationDeploymentStatus::FAILED->value); } }