Gerrit¶
Usage: lftools gerrit [OPTIONS] COMMAND [ARGS]...
GERRIT TOOLS.
Options:
--help Show this message and exit.
Commands:
abandonchanges Abandon all OPEN changes for a gerrit project.
addfile Add a file for review to a Project.
addgithubrights Grant Github read for a project.
addgitreview Add git review to a project.
addinfojob Add an INFO job for a new Project.
addmavenconfig Add maven config file for JCasC.
create-saml-group Create saml group based on ldap group.
createproject Create a project via the gerrit API.
list-project-inherits-from List who a project inherits from.
list-project-permissions List Owners of a Project.
Commands¶
list-project-permissions¶
Usage: lftools gerrit list-project-permissions [OPTIONS] GERRIT_FQDN PROJECT
List Owners of a Project.
Options:
--help Show this message and exit.
list-project-inherits-from¶
Usage: lftools gerrit list-project-inherits-from [OPTIONS] GERRIT_FQDN
GERRIT_PROJECT
List who a project inherits from.
Options:
--help Show this message and exit.
abandonchanges¶
Usage: lftools gerrit abandonchanges [OPTIONS] GERRIT_FQDN GERRIT_PROJECT
Abandon all OPEN changes for a gerrit project.
gerrit_url gerrit.o-ran-sc.org gerrit_project test/test1
Options:
--help Show this message and exit.
addgitreview¶
Usage: lftools gerrit addgitreview [OPTIONS] GERRIT_FQDN GERRIT_PROJECT
Add git review to a project.
Example: gerrit_url gerrit.o-ran-sc.org gerrit_project test/test1
Options:
--issue_id TEXT For projects that enforce an issue id for changesets
--help Show this message and exit.
addgithubrights¶
Usage: lftools gerrit addgithubrights [OPTIONS] GERRIT_FQDN GERRIT_PROJECT
Grant Github read for a project.
gerrit_url gerrit.o-ran-sc.org gerrit_project test/test1
Options:
--help Show this message and exit.
addfile¶
Usage: lftools gerrit addfile [OPTIONS] GERRIT_FQDN GERRIT_PROJECT FILENAME
Add a file for review to a Project.
Requires gerrit directory.
Example:
gerrit_url gerrit.o-ran-sc.org/r gerrit_project test/test1
Options:
--issue_id TEXT For projects that enforce an issue id for changesets
--file_location TEXT File path within the repository
--help Show this message and exit.
createproject¶
Usage: lftools gerrit createproject [OPTIONS] GERRIT_FQDN GERRIT_PROJECT
LDAP_GROUP
Create a project via the gerrit API.
Creates a gerrit project. Sets ldap group as owner.
Example:
gerrit_url gerrit.o-ran-sc.org/r gerrit_project test/test1 ldap_group oran-
gerrit-test-test1-committers
Options:
--description TEXT Project Description [required]
--check just check if the project exists
--help Show this message and exit.
create-saml-group¶
Usage: lftools gerrit create-saml-group [OPTIONS] GERRIT_FQDN LDAP_GROUP
Create saml group based on ldap group.
Options:
--help Show this message and exit.
addinfojob¶
Usage: lftools gerrit addinfojob [OPTIONS] GERRIT_FQDN GERRIT_PROJECT JJBREPO
Add an INFO job for a new Project.
Adds info verify jenkins job for project. result['id'] can be used to ammend
a review so that multiple projects can have info jobs added in a single
review
Example:
gerrit_url gerrit.o-ran-sc.org/r gerrit_project test/test1 jjbrepo ci-
mangement
Options:
--issue_id TEXT For projects that enforce an issue id for changesets
--agent TEXT Specify the Jenkins agent label to run the job on
--help Show this message and exit.
Note
Gerrit API methods require configuration in lftools.ini in a global [gerrit] section. support for [gerrit.umbrella.tld] exists as well signed_off_by required to push changes. Projects that do not allow self merge will require as project.example.org.second section for submission of their .gitreview on project creation.
[gerrit.example.org]
username = lfid
password = password
signed_off_by = Your Name <your@email.org>
[gerrit.example.org.second]
username = lfid2
password = password2
signed_off_by = Your Name <your@email.org>
addmavenconfig¶
Usage: lftools gerrit addmavenconfig [OPTIONS] GERRIT_FQDN GERRIT_PROJECT
JJBREPO
Add maven config file for JCasC.
The following options can be set in the gerrit server's entry in lftools.ini:
* default_servers: Comma-separated list of servers using the <projectname>
credential. Default: releases,snapshots,staging,site
* additional_credentials: JSON-formatted string containing
servername:credentialname pairings. This should be on a single line,
without quotes surrounding the string.
* nexus3: The nexus3 server url for a given project.
* nexus3_ports: Comma-separated list of ports used by Nexus3.
Default: 10001,10002,10003,10004
Options:
--issue_id TEXT For projects that enforce an issue id for changesets
--nexus3 TEXT Specify a Nexus 3 server, e.g. nexus3.example.org
--nexus3_ports TEXT Comma-separated list of ports supported by the Nexus 3
server specified
--help Show this message and exit.
An example of the lftools.ini entry for a Gerrit server making use of a full configuration:
[gerrit.example.org]
username = lfid
password = password
signed_off_by = Your Name <your@email.org>
endpoint = https://gerrit.example.org/
default_servers = releases,snapshots,staging,site
nexus3 = nexus3.example.org
nexus3_ports = 10001,10002,10003,10004
additional_credentials = {"docker.io": "dockerhub-cred", "nexus-iq": "nexus-iq-cred"}