gitlab_pipeline.go 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package model
  2. const (
  3. // HookPipelineType ...
  4. HookPipelineType = "pipeline"
  5. // PipelineFailed ...
  6. PipelineFailed = "failed"
  7. // PipelineSuccess ...
  8. PipelineSuccess = "success"
  9. // PipelineSkipped ...
  10. PipelineSkipped = "skipped"
  11. // PipelineCanceled ...
  12. PipelineCanceled = "canceled"
  13. // PipelineRunning ...
  14. PipelineRunning = "running"
  15. // PipelinePending ...
  16. PipelinePending = "pending"
  17. // MergeStatusOk ...
  18. MergeStatusOk = "can_be_merged"
  19. // MergeStateOpened ...
  20. MergeStateOpened = "opened"
  21. )
  22. // QueryStatus ...
  23. type QueryStatus int
  24. // query pipeline type.
  25. const (
  26. QueryProcessing QueryStatus = iota
  27. QuerySuccess
  28. QuerySuccessRmNote
  29. QueryID
  30. )
  31. // HookPipeline webhook for pipeline
  32. type HookPipeline struct {
  33. ObjectKind string `json:"object_kind"`
  34. User *User `json:"user"`
  35. Project *Project `json:"project"`
  36. ObjectAttributes *Pipeline `json:"object_attributes"`
  37. Commit *Commit `json:"commit"`
  38. }
  39. // Pipeline object_attributes for pipeline
  40. type Pipeline struct {
  41. ID int64 `json:"id"`
  42. Ref string `json:"ref"`
  43. Tag bool `json:"tag"`
  44. Sha string `json:"sha"`
  45. BeforeSha string `json:"before_sha"`
  46. Status string `json:"status"`
  47. Stages []string `json:"stages"`
  48. CreatedAt string `json:"created_at"`
  49. FinishedAt string `json:"finished_at"`
  50. Duration uint64 `json:"duration"`
  51. }