Added deployments overview
This commit is contained in:
@@ -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"`
|
||||
}
|
||||
Reference in New Issue
Block a user