Added deployments overview

This commit is contained in:
2026-04-06 22:04:50 +02:00
parent a95c76ce7e
commit 1978a31cbf
21 changed files with 1249 additions and 169 deletions
+35
View File
@@ -0,0 +1,35 @@
package models
type DeploymentStatus string
const (
DeploymentStatusPending DeploymentStatus = "pending"
DeploymentStatusRunning DeploymentStatus = "running"
DeploymentStatusSuccess DeploymentStatus = "success"
DeploymentStatusFailed DeploymentStatus = "failed"
)
func (s DeploymentStatus) IsValid() bool {
switch s {
case DeploymentStatusPending, DeploymentStatusRunning,
DeploymentStatusSuccess, DeploymentStatusFailed:
return true
}
return false
}
type Deployment struct {
Id string `json:"id"`
SiteId string `json:"site_id"`
CommitHash string `json:"commit_hash"`
Message string `json:"message"`
Status DeploymentStatus `json:"status"`
StartTime string `json:"start_time"`
FinishTime string `json:"finish_time"`
CreatedAt string `json:"created_at"`
}
type GetDeploymentsBySiteResponse struct {
Deployments []Deployment `json:"deployments"`
Total int `json:"total"`
}