Skip to content

Commit

Permalink
Merge pull request #75 from maguro/v5
Browse files Browse the repository at this point in the history
Update PipelineEventPayload with Job
  • Loading branch information
deankarn authored May 20, 2019
2 parents 2b63b48 + a8ef776 commit c205145
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
6 changes: 3 additions & 3 deletions gitlab/payload.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ type PipelineEventPayload struct {
Project Project `json:"project"`
Commit Commit `json:"commit"`
ObjectAttributes ObjectAttributes `json:"object_attributes"`
Builds []Build `json:"builds"`
Jobs []Job `json:"jobs"`
}

// CommentEventPayload contains the information for GitLab's comment event
Expand Down Expand Up @@ -193,8 +193,8 @@ type Issue struct {
IID int64 `json:"iid"`
}

// Build contains all of the GitLab build information
type Build struct {
// Job contains all of the GitLab job information
type Job struct {
ID int64 `json:"id"`
Stage string `json:"stage"`
Name string `json:"name"`
Expand Down
34 changes: 28 additions & 6 deletions testdata/gitlab/pipeline-event.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,21 @@
],
"created_at": "2016-08-12 15:23:28 UTC",
"finished_at": "2016-08-12 15:26:29 UTC",
"duration": 63
"duration": 63,
"variables": [
{
"key": "NESTOR_PROD_ENVIRONMENT",
"value": "us-west-1"
}
]
},
"user":{
"name": "Administrator",
"username": "root",
"avatar_url": "http://www.gravatar.com/avatar/e32bd13e2add097461cb96824b7a829c?s=80\u0026d=identicon"
},
"project":{
"id": 1,
"name": "Gitlab Test",
"description": "Atque in sunt eos similique dolores voluptatem.",
"web_url": "http://192.168.64.1:3005/gitlab-org/gitlab-test",
Expand All @@ -43,7 +50,7 @@
"email": "[email protected]"
}
},
"builds":[
"jobs":[
{
"id": 380,
"stage": "deploy",
Expand Down Expand Up @@ -80,7 +87,12 @@
"username": "root",
"avatar_url": "http://www.gravatar.com/avatar/e32bd13e2add097461cb96824b7a829c?s=80\u0026d=identicon"
},
"runner": null,
"runner": {
"id":380987,
"description":"shared-runners-manager-6.gitlab.com",
"active":true,
"is_shared":true
},
"artifacts_file":{
"filename": null,
"size": null
Expand All @@ -101,7 +113,12 @@
"username": "root",
"avatar_url": "http://www.gravatar.com/avatar/e32bd13e2add097461cb96824b7a829c?s=80\u0026d=identicon"
},
"runner": null,
"runner": {
"id":380987,
"description":"shared-runners-manager-6.gitlab.com",
"active":true,
"is_shared":true
},
"artifacts_file":{
"filename": null,
"size": null
Expand All @@ -122,7 +139,12 @@
"username": "root",
"avatar_url": "http://www.gravatar.com/avatar/e32bd13e2add097461cb96824b7a829c?s=80\u0026d=identicon"
},
"runner": null,
"runner": {
"id":380987,
"description":"shared-runners-manager-6.gitlab.com",
"active":true,
"is_shared":true
},
"artifacts_file":{
"filename": null,
"size": null
Expand Down Expand Up @@ -150,4 +172,4 @@
}
}
]
}
}

0 comments on commit c205145

Please sign in to comment.