2015-05-17 20:51:42 +00:00
|
|
|
package types
|
2015-04-07 08:20:55 +00:00
|
|
|
|
2015-06-23 03:45:08 +00:00
|
|
|
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"`
|
2015-06-23 03:45:08 +00:00
|
|
|
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"`
|
2015-05-11 07:45:31 +00:00
|
|
|
|
2015-06-23 03:45:08 +00:00
|
|
|
Commit *Commit `json:"head_commit"`
|
2015-08-10 03:18:21 +00:00
|
|
|
PullRequest *PullRequest `json:"pull_request,omitempty"`
|
2015-06-23 03:45:08 +00:00
|
|
|
|
|
|
|
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"`
|
2015-06-23 03:45:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
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"`
|
2015-06-23 03:45:08 +00:00
|
|
|
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"`
|
2015-06-23 03:45:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type Author struct {
|
2015-08-10 03:18:21 +00:00
|
|
|
Login string `json:"login,omitempty"`
|
|
|
|
Email string `json:"email,omitempty"`
|
2015-05-11 07:45:31 +00:00
|
|
|
}
|