Skip to content

Instantly share code, notes, and snippets.

@nblair
Created February 7, 2019 17:47
Show Gist options
  • Save nblair/64e1e33b2b4bde0700c36fe73b264d3e to your computer and use it in GitHub Desktop.
Save nblair/64e1e33b2b4bde0700c36fe73b264d3e to your computer and use it in GitHub Desktop.
Create a Google Cloud Blobstore with the Nexus Repository Manager Script API
import org.sonatype.nexus.blobstore.api.BlobStoreConfiguration
import org.sonatype.nexus.blobstore.api.BlobStoreManager
def blobStoreManager = container.lookup(BlobStoreManager.class.name)
blobStoreManager.create(new BlobStoreConfiguration(name: 'default', type: 'Google Cloud Storage',
attributes: [
'google cloud storage': [
bucket: "bucket-name-goes-here" // if you use an interpolated Groovy String here, make sure you call toString()
]
]))
@nblair
Copy link
Author

nblair commented Dec 20, 2019

This script only works up to and including Nexus Repository Manager 3.19.

In 3.20 and beyond, take a look at the changes needed here:

https://gist.github.com/nblair/85b34948de59e5a5f458fb81fb014d00

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment