#feature: add Jenkins deploy monitor & log clean task
This commit is contained in:
@@ -20,12 +20,16 @@ class Project extends BaseModel
|
||||
'git_version_cached_at',
|
||||
'log_app_names',
|
||||
'log_env',
|
||||
'jenkins_job_name',
|
||||
'jenkins_notify_enabled',
|
||||
'jenkins_last_notified_build',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'git_monitor_enabled' => 'boolean',
|
||||
'auto_create_release_branch' => 'boolean',
|
||||
'is_important' => 'boolean',
|
||||
'jenkins_notify_enabled' => 'boolean',
|
||||
'log_app_names' => 'array',
|
||||
'git_version_cached_at' => 'datetime',
|
||||
];
|
||||
@@ -86,4 +90,15 @@ class Project extends BaseModel
|
||||
->whereJsonContains('log_app_names', $appName)
|
||||
->first();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取所有启用 Jenkins 通知的项目
|
||||
*/
|
||||
public static function getJenkinsNotifyEnabled(): \Illuminate\Database\Eloquent\Collection
|
||||
{
|
||||
return static::query()
|
||||
->where('jenkins_notify_enabled', true)
|
||||
->whereNotNull('jenkins_job_name')
|
||||
->get();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user