Files
ServerKit/frontend/src/services/api/deploymentJobs.js
T
Juan Denis cc1151d0ce Add deployment jobs and remote deployment runner
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.
2026-04-29 00:39:16 -04:00

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}`);
}