Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update PipelineEventPayload with Job #75

Merged
merged 1 commit into from
May 20, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
}
}
]
}
}