520f29c16a
Switch deploying Gerrit extension and plugin API from Google storage bucket to Maven Central. To simplify the troubleshooting new trace option was added to underlying python script. When environment variable VERBOSE=1 is set, then the mvn command is printed to stderr: VERBOSE=1 buck build api_deploy_oss Change-Id: I9ebe44ec8aca91aa6b5514f561209e7c50377927
139 lines
4.0 KiB
Plaintext
139 lines
4.0 KiB
Plaintext
= Deploy Gerrit Artifacts
|
|
|
|
[[deploy-configuration-setting-maven-central]]
|
|
== Deploy Configuration settings for Maven Central
|
|
|
|
Gerrit Extension API Jar and the Gerrit Plugin API artifacts are stored on
|
|
Maven Central.
|
|
|
|
Prerequisites: Set up the Sonatype account (see link:https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide#SonatypeOSSMavenRepositoryUsageGuide-2.Signup[Sonatype
|
|
Maven Repository Usage Guide]) and put Sonatype user and password in
|
|
~/.m2/settings.xml:
|
|
|
|
----
|
|
<server>
|
|
<id>sonatype-nexus-staging</id>
|
|
<username>USER</username>
|
|
<password>PASSWORD</password>
|
|
</server>
|
|
----
|
|
|
|
PGP key must be generated and published, see
|
|
link:https://docs.sonatype.org/display/Repository/How+To+Generate+PGP+Signatures+With+Maven[How
|
|
To Generate PGP Signatures With Maven] for details. PGP passphrase can also be
|
|
put in ~/.m2/settings.xml:
|
|
|
|
----
|
|
<settings>
|
|
<profiles>
|
|
<profile>
|
|
<id>gpg</id>
|
|
<properties>
|
|
<gpg.executable>gpg2</gpg.executable>
|
|
<gpg.passphrase>mypassphrase</gpg.passphrase>
|
|
</properties>
|
|
</profile>
|
|
</profiles>
|
|
<activeProfiles>
|
|
<activeProfile>gpg</activeProfile>
|
|
</activeProfiles>
|
|
</settings>
|
|
----
|
|
|
|
It can also be included in the key chain on OS X.
|
|
|
|
Gerrit Subproject Artifacts are stored on
|
|
link:https://developers.google.com/storage/[Google Cloud Storage].
|
|
Via the link:https://code.google.com/apis/console/?noredirect[API Console] the
|
|
Gerrit maintainers have access to the `Gerrit Code Review` project.
|
|
This projects host several buckets for storing Gerrit artifacts:
|
|
|
|
* `gerrit-api`:
|
|
+
|
|
Bucket to store the Gerrit Extension API Jar and the Gerrit Plugin API
|
|
Jar.
|
|
|
|
* `gerrit-maven`:
|
|
+
|
|
Bucket to store Gerrit Subproject Artifacts (e.g. `gwtjsonrpc` etc.).
|
|
|
|
[[deploy-configuration-settings-xml]]
|
|
== Deploy Configuration in Maven `settings.xml`
|
|
|
|
To upload artifacts to a bucket the user must authenticate with a
|
|
username and password. The username and password need to be retrieved
|
|
from the link:https://code.google.com/apis/console/?noredirect[API Console]:
|
|
|
|
* Go to the `Gerrit Code Review` project
|
|
* In the menu on the left select `Google Cloud Storage` >
|
|
`Interoperable Access`
|
|
* Use the `Access Key` as username
|
|
* Click under `Secret` on the `Show` button to find the password
|
|
|
|
To make the username and password known to Maven, they must be
|
|
configured in the `~/.m2/settings.xml` file.
|
|
|
|
----
|
|
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
|
|
<servers>
|
|
<server>
|
|
<id>gerrit-api-repository</id>
|
|
<username>GOOG..EXAMPLE.....EXAMPLE</username>
|
|
<password>EXAMPLE..EXAMPLE..EXAMPLE</password>
|
|
</server>
|
|
<server>
|
|
<id>gerrit-maven-repository</id>
|
|
<username>GOOG..EXAMPLE.....EXAMPLE</username>
|
|
<password>EXAMPLE..EXAMPLE..EXAMPLE</password>
|
|
</server>
|
|
<server>
|
|
<id>gerrit-plugins-repository</id>
|
|
<username>GOOG..EXAMPLE.....EXAMPLE</username>
|
|
<password>EXAMPLE..EXAMPLE..EXAMPLE</password>
|
|
</server>
|
|
</servers>
|
|
</settings>
|
|
----
|
|
|
|
[[deploy-configuration-subprojects]]
|
|
=== Gerrit Subprojects
|
|
|
|
* You will need to have the following in the `pom.xml` to make it
|
|
deployable to the `gerrit-maven` storage bucket:
|
|
|
|
----
|
|
<distributionManagement>
|
|
<repository>
|
|
<id>gerrit-maven-repository</id>
|
|
<name>Gerrit Maven Repository</name>
|
|
<url>gs://gerrit-maven</url>
|
|
<uniqueVersion>true</uniqueVersion>
|
|
</repository>
|
|
</distributionManagement>
|
|
----
|
|
|
|
|
|
* Add this to the `pom.xml` to enable the wagon provider:
|
|
|
|
----
|
|
<build>
|
|
<extensions>
|
|
<extension>
|
|
<groupId>com.googlesource.gerrit</groupId>
|
|
<artifactId>gs-maven-wagon</artifactId>
|
|
<version>3.3</version>
|
|
</extension>
|
|
</extensions>
|
|
</build>
|
|
----
|
|
|
|
|
|
GERRIT
|
|
------
|
|
Part of link:index.html[Gerrit Code Review]
|
|
|
|
SEARCHBOX
|
|
---------
|