gerrit/Documentation/cmd-plugin-install.txt
David Ostrovsky 366ad0eae8 Allow plugins to provide their own name
Plugin name is an important part for plugin developers and users: it drives
SSH command names, REST API endpoints, used as a prefix in project.config for
plugin-owned capabilities and can be used in project.config sections for
project specific configuration.

Currently there is no way for a plugin to provide its own name. When a new
version of a plugin is released and it is copied to $site/plugins folders
with unchanged name:

 replication-2.8.SNAPSHOT.jar

then the plugin name in all places mentioned above is changed.

With this change plugin name can be optionally provided by plugins, instead of
deriving it from the plugin file name. To provide its own plugin name, plugin
has to put the following line in the manifest file:

 Gerrit-PluginName: replication

This is especially useful for plugins that contribute plugin-owned capabilities
that are stored in project.config file as

 [plugin-name]-[capability-name]

Other use case is to be able to put project specific plugin configuration
section in project.config. In this case it is advantageous to reserve the
plugin name to access the configuration section in project.config file.

Multiple versions of the same plugin with different file names can not be
deployed on one Gerrit installation site: only the first plugin can be
successful deployed. All other plugins with the same name are disabled.

If plugin provides its own name, it has some implications for SSH install
command and PUT /plugins/plugin-name REST endpoint. In both cases a name of the
plugin to install is passed from the user. If the plugin provides its own name
in MANIFEST file, the plugin name from the MANIFEST file has precedence over
the name passed to the SSH command or REST endpoint.

Change-Id: If28349e95be2e90c6ee8169a72ba8cd642b49b98
2013-09-26 10:56:18 +09:00

74 lines
1.4 KiB
Plaintext

plugin install
==============
NAME
----
plugin install - Install/Add a plugin.
plugin add - Install/Add a plugin.
SYNOPSIS
--------
[verse]
'ssh' -p <port> <host> 'gerrit plugin install | add'
[--name <NAME> | -n <NAME>]
- | <URL> | <PATH>
DESCRIPTION
-----------
Install/Add a plugin. The plugin will be copied into the site path's
`plugins` directory.
ACCESS
------
Caller must be a member of the privileged 'Administrators' group.
SCRIPTING
---------
This command is intended to be used in scripts.
OPTIONS
-------
-::
Plugin jar as piped input.
<URL>::
URL from where the plugin should be downloaded. This can be an
HTTP or FTP site.
<PATH>::
Absolute file path to the plugin jar.
--name::
-n::
The name under which the plugin should be installed. Note: if the plugin
provides its own name in the MANIFEST file, then the plugin name from the
MANIFEST file has precedence over this option.
EXAMPLES
--------
Install a plugin from an absolute file path on the server's host:
====
ssh -p 29418 localhost gerrit plugin install -n name \
$(pwd)/my-plugin.jar
====
Install a plugin from an HTTP site:
====
ssh -p 29418 localhost gerrit plugin install -n name \
http://build-server/output/our-plugin.jar
====
Install a plugin from piped input:
====
ssh -p 29418 localhost gerrit plugin install -n name \
- <target/name-0.1.jar
====
GERRIT
------
Part of link:index.html[Gerrit Code Review]