-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtest.groovy
143 lines (142 loc) · 7.56 KB
/
test.groovy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
def json = """[{
"url": "https://api.github.com/repos/myname/repo/releases/12",
"assets_url": "https://api.github.com/repos/myname/repo/releases/12/assets",
"upload_url": "https://uploads.github.com/repos/myname/repo/releases/12/assets{?name,label}",
"html_url": "https://github.com/myname/repo/releases/tag/12.4.4",
"id": 123,
"tag_name": "12.4.4",
"target_commitish": "master",
"name": "12.4.4",
"draft": false,
"author": {
"login": "org",
"id": 123,
"avatar_url": "https://avatars2.githubusercontent.com/u/123?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/org",
"html_url": "https://github.com/org",
"followers_url": "https://api.github.com/users/org/followers",
"following_url": "https://api.github.com/users/org/following{/other_user}",
"gists_url": "https://api.github.com/users/org/gists{/gist_id}",
"starred_url": "https://api.github.com/users/org/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/org/subscriptions",
"organizations_url": "https://api.github.com/users/org/orgs",
"repos_url": "https://api.github.com/users/org/repos",
"events_url": "https://api.github.com/users/org/events{/privacy}",
"received_events_url": "https://api.github.com/users/org/received_events",
"type": "User",
"site_admin": false
},
"prerelease": true,
"created_at": "2017-06-01T09:38:32Z",
"published_at": "2017-06-06T11:46:09Z",
"assets": [{
"url": "https://api.github.com/repos/myname/repo/releases/assets/123",
"id": 123,
"name": "repo-8.4.4.aar",
"label": "",
"uploader": {
"login": "org",
"id": 123,
"avatar_url": "https://avatars5.githubusercontent.com/u/123?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/org",
"html_url": "https://github.com/org",
"followers_url": "https://api.github.com/users/org/followers",
"following_url": "https://api.github.com/users/org/following{/other_user}",
"gists_url": "https://api.github.com/users/org/gists{/gist_id}",
"starred_url": "https://api.github.com/users/org/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/org/subscriptions",
"organizations_url": "https://api.github.com/users/org/orgs",
"repos_url": "https://api.github.com/users/org/repos",
"events_url": "https://api.github.com/users/org/events{/privacy}",
"received_events_url": "https://api.github.com/users/org/received_events",
"type": "User",
"site_admin": false
},
"content_type": "application/zip",
"state": "uploaded",
"size": 155192,
"download_count": 0,
"created_at": "2017-06-06T11:46:11Z",
"updated_at": "2017-06-06T11:46:12Z",
"browser_download_url": "https://github.com/myname/repo/releases/download/4.4/repo-12.4.4.aar"
},
{
"url": "https://api.github.com/repos/myname/repo/releases/assets/123",
"id": 123,
"name": "repo-5.2.0.aar",
"label": "",
"uploader": {
"login": "org",
"id": 20902440,
"avatar_url": "https://avatars3.githubusercontent.com/u/123?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/org",
"html_url": "https://github.com/org",
"followers_url": "https://api.github.com/users/org/followers",
"following_url": "https://api.github.com/users/org/following{/other_user}",
"gists_url": "https://api.github.com/users/org/gists{/gist_id}",
"starred_url": "https://api.github.com/users/org/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/org/subscriptions",
"organizations_url": "https://api.github.com/users/org/orgs",
"repos_url": "https://api.github.com/users/org/repos",
"events_url": "https://api.github.com/users/org/events{/privacy}",
"received_events_url": "https://api.github.com/users/org/received_events",
"type": "User",
"site_admin": false
},
"content_type": "application/zip",
"state": "uploaded",
"size": 1779617,
"download_count": 0,
"created_at": "2017-06-06T11:46:12Z",
"updated_at": "2017-06-06T11:46:13Z",
"browser_download_url": "https://github.com/myname/repo/releases/download/.4.4/repo-5.2.0.aar"
}
],
"tarball_url": "https://api.github.com/repos/myname/repo/tarball/12.4.4",
"zipball_url": "https://api.github.com/repos/myname/repo/zipball/12.4.4",
"body": "[MYSTATS-2695](jira.dev.company.co.uk/browse/…) - Jenkins build pipeline should ignore draft and pre-releases\r\n"
},
{
"url": "https://api.github.com/repos/myname/repo/releases/123",
"assets_url": "https://api.github.com/repos/myname/repo/releases/6616643/assets",
"upload_url": "https://uploads.github.com/repos/myname/repo/releases/6616643/assets{?name,label}",
"html_url": "https://github.com/myname/repo/releases/tag/.4.3",
"id": 6616643,
"tag_name": "12.4.3",
"target_commitish": "develop",
"name": "Test Release",
"draft": false,
"author": {
"login": "myname",
"id": 1084186,
"avatar_url": "https://avatars5.githubusercontent.com/u/123?v=3",
"gravatar_id": "",
"url": "https://api.github.com/users/myname",
"html_url": "https://github.com/myname",
"followers_url": "https://api.github.com/users/myname/followers",
"following_url": "https://api.github.com/users/myname/following{/other_user}",
"gists_url": "https://api.github.com/users/myname/gists{/gist_id}",
"starred_url": "https://api.github.com/users/myname/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/myname/subscriptions",
"organizations_url": "https://api.github.com/users/myname/orgs",
"repos_url": "https://api.github.com/users/myname/repos",
"events_url": "https://api.github.com/users/myname/events{/privacy}",
"received_events_url": "https://api.github.com/users/myname/received_events",
"type": "User",
"site_admin": false
},
"prerelease": false,
"created_at": "2017-06-06T09:39:44Z",
"published_at": "2017-06-06T11:44:43Z",
"assets": [
],
"tarball_url": "https://api.github.com/repos/myname/repo/tarball/.4.3",
"zipball_url": "https://api.github.com/repos/myname/repo/zipball/.4.3",
"body": ""
}
]"""
list = new groovy.json.JsonSlurper().parseText(json)
println new groovy.json.JsonBuilder(list.findAll{ it.prerelease != true }).toPrettyString()