File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
app/Http/Controllers/Webhook Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -340,7 +340,6 @@ public function normal(Request $request)
340
340
return response ("Nothing to do. No applications found with branch ' $ base_branch'. " );
341
341
}
342
342
}
343
-
344
343
foreach ($ applications as $ application ) {
345
344
$ isFunctional = $ application ->destination ->server ->isFunctional ();
346
345
if (! $ isFunctional ) {
@@ -432,8 +431,13 @@ public function normal(Request $request)
432
431
if ($ action === 'closed ' || $ action === 'close ' ) {
433
432
$ found = ApplicationPreview::where ('application_id ' , $ application ->id )->where ('pull_request_id ' , $ pull_request_id )->first ();
434
433
if ($ found ) {
435
- $ container_name = generateApplicationContainerName ($ application , $ pull_request_id );
436
- instant_remote_process (["docker rm -f $ container_name " ], $ application ->destination ->server );
434
+ $ containers = getCurrentApplicationContainerStatus ($ application ->destination ->server , $ application ->id , $ pull_request_id );
435
+ if ($ containers ->isNotEmpty ()) {
436
+ $ containers ->each (function ($ container ) use ($ application ) {
437
+ $ container_name = data_get ($ container , 'Names ' );
438
+ instant_remote_process (["docker rm -f $ container_name " ], $ application ->destination ->server );
439
+ });
440
+ }
437
441
438
442
ApplicationPullRequestUpdateJob::dispatchSync (application: $ application , preview: $ found , status: ProcessStatus::CLOSED );
439
443
$ found ->delete ();
You can’t perform that action at this time.
0 commit comments