mirror of
https://github.com/jhd3197/ServerKit.git
synced 2026-12-02 13:15:17 +09:00
Introduce a deployment jobs system to support cross-server template installations and remote execution. Adds DeploymentJob and DeploymentJobLog models, DeploymentJobService for job lifecycle, and DeploymentPlanRunner to execute plans locally or via agents. TemplateService gains build_install_plan and related helpers to produce executable plans; Template installs can run async (202) or synchronously. Backend API/CLI updated: new deployment-jobs endpoints, apps API uses RemoteDockerService for remote compose actions, and CLI commands (deploy-template, deployment-status, list-servers) were added. Agent and config changes: file access validation with allowed_paths, file write create_dirs option, default allowed paths, and install script/systemd read-write paths updated to permit /var/lib/serverkit and /var/serverkit. Migration file for deployment_jobs schema included.
20 lines
769 B
JavaScript
20 lines
769 B
JavaScript
// Deployment jobs and logs
|
|
|
|
export async function getDeploymentJobs(params = {}) {
|
|
const query = new URLSearchParams();
|
|
if (params.status) query.append('status', params.status);
|
|
if (params.serverId) query.append('server_id', params.serverId);
|
|
if (params.limit) query.append('limit', params.limit);
|
|
const suffix = query.toString() ? `?${query}` : '';
|
|
return this.request(`/deployment-jobs${suffix}`);
|
|
}
|
|
|
|
export async function getDeploymentJob(jobId, includeLogs = true) {
|
|
return this.request(`/deployment-jobs/${jobId}?logs=${includeLogs}`);
|
|
}
|
|
|
|
export async function getDeploymentJobLogs(jobId, afterId = null) {
|
|
const suffix = afterId ? `?after_id=${afterId}` : '';
|
|
return this.request(`/deployment-jobs/${jobId}/logs${suffix}`);
|
|
}
|