This project adds Google Cloud Object Storage backed blobstores to Sonatype Nexus Repository 3. It allows Nexus Repository to store the components and assets in Google Cloud instead of a local filesystem.
Go read our contribution guidelines to get a bit more familiar with how we would like things to flow.
- Apache Maven 3.3.3+
- Java 8+
- Network access to https://repository.sonatype.org/content/groups/sonatype-public-grid
Also, there is a good amount of information available at Bundle Development Overview
To build the project and generate the bundle use Maven:
mvn clean install
After you have built the project, run the provided install script
sh ./install-plugin.sh path/to/your/nxrm3/install
Edit path/to/your/nxrm3/install/system/org/sonatype/nexus/assemblies/nexus-core-feature/${NEXUS_VERSION}/nexus-core-feature-${NEXUS_VERSION}-features.xml
:
<feature version="0.3.0.SNAPSHOT" prerequisite="false" dependency="false">nexus-blobstore-google-cloud</feature>
That line should be added at about line 14, directly after:
<feature version="3.11.0" prerequisite="false" dependency="false">nexus-task-log-cleanup</feature>
Next, you will need to create an account with appropriate permissions.
Of the predefined account roles, Storage Admin
will grant the plugin to create any Google Cloud Storage Buckets you
require and administer all of the objects within, but it will also have access to manage any other Google Cloud Storage
Buckets associated with the project.
If you are using custom roles, the account will need:
- (required)
storage.objects.*
- (required)
storage.buckets.get
- or
storage.buckets.*
.
If you only provide permissions 1 and 2, you will have to create any Google Cloud Storage Buckets in advance of assigning them to Nexus Repository Manager blob stores. The third option will allow the plugin to create buckets for you.
If you are creating the Google Cloud Storage Buckets in advance, you should use either the 'Multi-Regional' or 'Regional' storage class; 'Nearline' and 'Coldline' are not suitable for Nexus Repository Manager workloads. If you let the plugin create the bucket, it will use the 'Multi-Regional' storage class.
Per the Google Cloud documentation:
- Generate a JSON Service Account key
- Store this file on the filesystem with appropriate permissions for the user running Nexus to read it.
- (optional, but recommended) Set the
GOOGLE_APPLICATION_CREDENTIALS
environment variable for the user running Nexus:
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/key.json
A restart of Nexus Repository Manager is required to complete the installation process.
Log in as admin and create a new blobstore, selecting 'Google Cloud Storage' as the type.
If you did not set the environment variable in Step 3 above, specify the absolute path to the JSON Service Account key file.
It is worth noting that this is NOT SUPPORTED by Sonatype, and is a contribution of ours to the open source community (read: you!)
Remember:
- Use this contribution at the risk tolerance that you have
- Do NOT file Sonatype support tickets related to Google Cloud support
- DO file issues here on GitHub, so that the community can pitch in
Phew, that was easier than I thought. Last but not least of all:
Have fun creating and using this plugin and the Nexus platform, we are glad to have you here!
Looking to contribute to our code but need some help? There's a few ways to get information:
- Chat with us on Gitter
- Check out the Nexus3 tag on Stack Overflow
- Check out the Nexus Repository User List