README
¶
Gerrit Resource for Concourse
Tracks Gerrit change revisions (patch sets).
This is not an official Google product.
Usage
Define a new resource type for your pipeline:
resource_types:
- name: gerrit
type: docker-image
source:
repository: us.gcr.io/concourse-resources/gerrit-resource
Source Configuration
-
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.
Behavior
check: Check for new revisions.
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.
in: Clone the git repository at the given revision.
The repository is cloned and the given revision is checked out.
Parameters
-
fetch_protocol: A protocol name used to resolve a fetch URL for the given revision. For more information see thefetchfield in the Gerrit REST API documenation. Defaults tohttporanonymous httpif available. -
fetch_url: A URL to the Gerrit git repository where the given revision can be found. Overridesfetch_protocol.
out
The given revision is updated with the given message and/or label(s).
Parameters
-
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 overridesmessageunless readingmessage_filefails, in which casemessageis used instead. If readingmessage_filefails andmessageis not specified then theputwill 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}.
Example Pipeline
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}
Documentation
¶
There is no documentation for this package.