Merge branch 'next' into next
This commit is contained in:
@@ -18,7 +18,11 @@ class CleanupDatabase extends Command
|
|||||||
} else {
|
} else {
|
||||||
echo "Running database cleanup in dry-run mode...\n";
|
echo "Running database cleanup in dry-run mode...\n";
|
||||||
}
|
}
|
||||||
$keep_days = 60;
|
if (isCloud()) {
|
||||||
|
$keep_days = 60;
|
||||||
|
} else {
|
||||||
|
$keep_days = 60;
|
||||||
|
}
|
||||||
echo "Keep days: $keep_days\n";
|
echo "Keep days: $keep_days\n";
|
||||||
// Cleanup failed jobs table
|
// Cleanup failed jobs table
|
||||||
$failed_jobs = DB::table('failed_jobs')->where('failed_at', '<', now()->subDays(1));
|
$failed_jobs = DB::table('failed_jobs')->where('failed_at', '<', now()->subDays(1));
|
||||||
|
|||||||
@@ -451,6 +451,11 @@ class Application extends BaseModel
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isRunning()
|
||||||
|
{
|
||||||
|
return (bool) str($this->status)->startsWith('running');
|
||||||
|
}
|
||||||
|
|
||||||
public function isExited()
|
public function isExited()
|
||||||
{
|
{
|
||||||
return (bool) str($this->status)->startsWith('exited');
|
return (bool) str($this->status)->startsWith('exited');
|
||||||
|
|||||||
@@ -35,6 +35,11 @@ class ApplicationPreview extends BaseModel
|
|||||||
return self::where('application_id', $application_id)->where('pull_request_id', $pull_request_id)->firstOrFail();
|
return self::where('application_id', $application_id)->where('pull_request_id', $pull_request_id)->firstOrFail();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isRunning()
|
||||||
|
{
|
||||||
|
return (bool) str($this->status)->startsWith('running');
|
||||||
|
}
|
||||||
|
|
||||||
public function application()
|
public function application()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(Application::class);
|
return $this->belongsTo(Application::class);
|
||||||
|
|||||||
@@ -77,6 +77,11 @@ class Service extends BaseModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isRunning()
|
||||||
|
{
|
||||||
|
return (bool) str($this->status())->contains('running');
|
||||||
|
}
|
||||||
|
|
||||||
public function isExited()
|
public function isExited()
|
||||||
{
|
{
|
||||||
return (bool) str($this->status())->contains('exited');
|
return (bool) str($this->status())->contains('exited');
|
||||||
|
|||||||
@@ -36,16 +36,23 @@ function collectDockerNetworksByServer(Server $server)
|
|||||||
}
|
}
|
||||||
// Service networks
|
// Service networks
|
||||||
foreach ($server->services()->get() as $service) {
|
foreach ($server->services()->get() as $service) {
|
||||||
$networks->push($service->networks());
|
if ($service->isRunning()) {
|
||||||
|
$networks->push($service->networks());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Docker compose based apps
|
// Docker compose based apps
|
||||||
$docker_compose_apps = $server->dockerComposeBasedApplications();
|
$docker_compose_apps = $server->dockerComposeBasedApplications();
|
||||||
foreach ($docker_compose_apps as $app) {
|
foreach ($docker_compose_apps as $app) {
|
||||||
$networks->push($app->uuid);
|
if ($app->isRunning()) {
|
||||||
|
$networks->push($app->uuid);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Docker compose based preview deployments
|
// Docker compose based preview deployments
|
||||||
$docker_compose_previews = $server->dockerComposeBasedPreviewDeployments();
|
$docker_compose_previews = $server->dockerComposeBasedPreviewDeployments();
|
||||||
foreach ($docker_compose_previews as $preview) {
|
foreach ($docker_compose_previews as $preview) {
|
||||||
|
if (! $preview->isRunning()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$pullRequestId = $preview->pull_request_id;
|
$pullRequestId = $preview->pull_request_id;
|
||||||
$applicationId = $preview->application_id;
|
$applicationId = $preview->application_id;
|
||||||
$application = Application::find($applicationId);
|
$application = Application::find($applicationId);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ return [
|
|||||||
|
|
||||||
// The release version of your application
|
// The release version of your application
|
||||||
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
|
// Example with dynamic git hash: trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD'))
|
||||||
'release' => '4.0.0-beta.319',
|
'release' => '4.0.0-beta.320',
|
||||||
// When left empty or `null` the Laravel environment will be used
|
// When left empty or `null` the Laravel environment will be used
|
||||||
'environment' => config('app.env'),
|
'environment' => config('app.env'),
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
return '4.0.0-beta.319';
|
return '4.0.0-beta.320';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"coolify": {
|
"coolify": {
|
||||||
"v4": {
|
"v4": {
|
||||||
"version": "4.0.0-beta.319"
|
"version": "4.0.0-beta.320"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user