harness-drone/pkg/types/build.go

49 lines
1.3 KiB
Go
Raw Normal View History

2015-05-17 20:51:42 +00:00
package types
const (
StatePending = "pending"
StateRunning = "running"
StateSuccess = "success"
StateFailure = "failure"
StateKilled = "killed"
StateError = "error"
)
type Build struct {
2015-09-08 21:32:05 +00:00
ID int64 `json:"id"`
RepoID int64 `json:"-" sql:"unique:ux_build_number,index:ix_build_repo_id"`
Number int `json:"number" sql:"unique:ux_build_number"`
2015-09-04 00:21:08 +00:00
Event string `json:"event"`
2015-06-19 00:36:52 +00:00
Status string `json:"status"`
Started int64 `json:"started_at"`
Finished int64 `json:"finished_at"`
Commit *Commit `json:"head_commit"`
2015-08-10 03:18:21 +00:00
PullRequest *PullRequest `json:"pull_request,omitempty"`
Jobs []*Job `json:"jobs,omitempty" sql:"-"`
}
type PullRequest struct {
2015-08-10 03:18:21 +00:00
Number int `json:"number,omitempty"`
Title string `json:"title,omitempty"`
2015-09-04 00:21:08 +00:00
Link string `json:"link_url,omitempty"`
2015-08-10 03:18:21 +00:00
Base *Commit `json:"base_commit,omitempty"`
}
type Commit struct {
Sha string `json:"sha"`
Ref string `json:"ref"`
2015-09-04 00:21:08 +00:00
Link string `json:"link_url,omitempty"`
Branch string `json:"branch" sql:"index:ix_commit_branch"`
Message string `json:"message"`
2015-08-10 03:18:21 +00:00
Timestamp string `json:"timestamp,omitempty"`
Remote string `json:"remote,omitempty"`
Author *Author `json:"author,omitempty"`
}
type Author struct {
2015-08-10 03:18:21 +00:00
Login string `json:"login,omitempty"`
Email string `json:"email,omitempty"`
}