updates
This commit is contained in:
		
							parent
							
								
									726d46c3c1
								
							
						
					
					
						commit
						ca777384eb
					
				| @ -45,10 +45,13 @@ class Previews extends Component | |||||||
|     { |     { | ||||||
|         try { |         try { | ||||||
|             $this->set_deployment_uuid(); |             $this->set_deployment_uuid(); | ||||||
|             ApplicationPreview::create([ |             $found = ApplicationPreview::where('application_id', $this->application->id)->where('pull_request_id', $pull_request_id)->first(); | ||||||
|                 'application_id' => $this->application->id, |             if (!$found) { | ||||||
|                 'pull_request_id' => $pull_request_id, |                 ApplicationPreview::create([ | ||||||
|             ]); |                     'application_id' => $this->application->id, | ||||||
|  |                     'pull_request_id' => $pull_request_id, | ||||||
|  |                 ]); | ||||||
|  |             } | ||||||
|             queue_application_deployment( |             queue_application_deployment( | ||||||
|                 application_id: $this->application->id, |                 application_id: $this->application->id, | ||||||
|                 deployment_uuid: $this->deployment_uuid, |                 deployment_uuid: $this->deployment_uuid, | ||||||
|  | |||||||
| @ -202,8 +202,8 @@ COPY --from=$this->build_image_name /app/{$this->application->publish_directory} | |||||||
|     } |     } | ||||||
|     private function deploy_pull_request() |     private function deploy_pull_request() | ||||||
|     { |     { | ||||||
|         $this->build_image_name = "{$this->application->uuid}:pr_{$this->pull_request_id}-build"; |         $this->build_image_name = "{$this->application->uuid}:pr-{$this->pull_request_id}-build"; | ||||||
|         $this->production_image_name = "{$this->application->uuid}:pr_{$this->pull_request_id}"; |         $this->production_image_name = "{$this->application->uuid}:pr-{$this->pull_request_id}"; | ||||||
|         $this->container_name = generate_container_name($this->application->uuid, $this->pull_request_id); |         $this->container_name = generate_container_name($this->application->uuid, $this->pull_request_id); | ||||||
|         // Deploy pull request
 |         // Deploy pull request
 | ||||||
|         $this->execute_now([ |         $this->execute_now([ | ||||||
| @ -577,7 +577,7 @@ COPY --from=$this->build_image_name /app/{$this->application->publish_directory} | |||||||
|     { |     { | ||||||
|         $git_clone_command = "git clone -q -b {$this->application->git_branch}"; |         $git_clone_command = "git clone -q -b {$this->application->git_branch}"; | ||||||
|         if ($this->pull_request_id) { |         if ($this->pull_request_id) { | ||||||
|             $pr_branch_name = "pr_{$this->pull_request_id}_coolify"; |             $pr_branch_name = "pr-{$this->pull_request_id}-coolify"; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         if ($this->application->deploymentType() === 'source') { |         if ($this->application->deploymentType() === 'source') { | ||||||
|  | |||||||
| @ -42,7 +42,7 @@ function get_container_status(Server $server, string $container_id, bool $throwE | |||||||
| function generate_container_name(string $uuid, int|null $pull_request_id = null) | function generate_container_name(string $uuid, int|null $pull_request_id = null) | ||||||
| { | { | ||||||
|     if ($pull_request_id) { |     if ($pull_request_id) { | ||||||
|         return $uuid . '_pr_' . $pull_request_id; |         return $uuid . '-pr-' . $pull_request_id; | ||||||
|     } else { |     } else { | ||||||
|         return $uuid; |         return $uuid; | ||||||
|     } |     } | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user