Tracks Gerrit change revisions (patch sets).
This is not an official Google product.
Define a new resource type for your pipeline:
resource_types:
- name: gerrit
type: docker-image
source:
repository: us.gcr.io/concourse-resources/gerrit-resource
-
url
: Required. The base URL of the Gerrit REST API. -
query
: A Gerrit Search query matching desired changes. Defaults tostatus:open
. You may want to specify a project like:status:open project:my-project
. See Gerrit documentation on Searching Changes. -
cookies
: A string containing cookies in "Netscape cookie file format" (as supported by libcurl) to be used when connecting to Gerrit. Usually used for authentication. -
username
: A username for HTTP Basic authentication to Gerrit. -
password
: A password for HTTP Basic authentication to Gerrit. -
digest_auth
: Iftrue
, use HTTP Digest auth instead of Basic auth.
The Gerrit REST API is queried for revisions created since the given version was created. If no version is given, the latest revision of the most recently updated change is returned.
The repository is cloned and the given revision is checked out.
-
fetch_protocol
: A protocol name used to resolve a fetch URL for the given revision. For more information see thefetch
field in the Gerrit REST API documenation. Defaults tohttp
oranonymous http
if available. -
fetch_url
: A URL to the Gerrit git repository where the given revision can be found. Overridesfetch_protocol
.
The given revision is updated with the given message and/or label(s).
-
repository
: Required. The directory previously cloned byin
; usually just the resource name. -
message
: A message to be posted as a comment on the given revision. The message can contain build metadata variables. (e.g.: ${BUILD_ID}) See the [Concourse.CI Metadata Documentation](https://concourse.ci/implementing-resources.html#section_resource-metadata for a complete list of variables. -
message_file
: Path to a file containing a message to be posted as a comment on the given revision. This overridesmessage
unless readingmessage_file
fails, in which casemessage
is used instead. If readingmessage_file
fails andmessage
is not specified then theput
will fail. The message can contain build metadata variables. (e.g.: ${BUILD_ID}) See the [Concourse.CI Metadata Documentation](https://concourse.ci/implementing-resources.html#section_resource-metadata for a complete list of variables. -
labels
: A map of label names to integers to set on the given revision, e.g.:{Verified: 1}
.
resource_types:
- name: gerrit
type: docker-image
source:
repository: us.gcr.io/concourse-resources/gerrit-resource
resources:
- name: example-gerrit
type: gerrit
source:
url: https://review.example.com
query: status:open project:example
cookies: ((gerrit-cookies))
jobs:
- name: example-ci
plan:
# Trigger this job for every new patch set
- get: example-gerrit
version: every
trigger: true
- task: example-ci
file: example-gerrit/ci.yml
# After a successfuly build, mark the patch set Verified +1
- put: example-gerrit
params:
repository: example-gerrit
message: CI passed!
labels: {Verified: 1}