From a8ef7768a6a25a7a275ce3be9f2cca653a1966c8 Mon Sep 17 00:00:00 2001 From: "Alan D. Cabrera" Date: Sun, 19 May 2019 22:46:55 -0700 Subject: [PATCH] Update Pipeline even with jobs --- gitlab/payload.go | 6 ++--- testdata/gitlab/pipeline-event.json | 34 ++++++++++++++++++++++++----- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/gitlab/payload.go b/gitlab/payload.go index 0e62b13..bbee366 100644 --- a/gitlab/payload.go +++ b/gitlab/payload.go @@ -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 @@ -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"` diff --git a/testdata/gitlab/pipeline-event.json b/testdata/gitlab/pipeline-event.json index c203215..46da594 100644 --- a/testdata/gitlab/pipeline-event.json +++ b/testdata/gitlab/pipeline-event.json @@ -14,7 +14,13 @@ ], "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", @@ -22,6 +28,7 @@ "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", @@ -43,7 +50,7 @@ "email": "user@gitlab.com" } }, - "builds":[ + "jobs":[ { "id": 380, "stage": "deploy", @@ -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 @@ -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 @@ -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 @@ -150,4 +172,4 @@ } } ] -} \ No newline at end of file +}