-
Notifications
You must be signed in to change notification settings - Fork 86
Expand file tree
/
Copy pathBasic.groovy
More file actions
executable file
·22 lines (18 loc) · 896 Bytes
/
Basic.groovy
File metadata and controls
executable file
·22 lines (18 loc) · 896 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env groovy
@Grab('com.urswolfer.gerrit.client.rest:gerrit-rest-java-client:0.8.8')
import com.google.gerrit.extensions.api.GerritApi
import com.google.gerrit.extensions.common.ChangeInfo
import com.urswolfer.gerrit.client.rest.GerritAuthData
import com.urswolfer.gerrit.client.rest.GerritRestApiFactory
/**
* This is a very basic example written in Groovy: http://www.groovy-lang.org
*
* Once you have installed Groovy, make sure this file is executable. Run it with ./Basic.groovy.
*/
GerritRestApiFactory gerritRestApiFactory = new GerritRestApiFactory()
GerritAuthData.Basic authData = new GerritAuthData.Basic('http://localhost:8080'/*, 'user', 'password'*/)
GerritApi gerritApi = gerritRestApiFactory.create(authData)
List<ChangeInfo> changes = gerritApi.changes().query('status:open').withLimit(10).get()
changes.each { ci ->
println "${ci.changeId} ${ci.subject}"
}