Name: nexus-webhook-publish
Owner: Sonatype Community
Description: A lil Golang app that takes Nexus Repo webhooks and uses them to publish components to other repos such as npmjs
Created: 2017-11-16 22:41:42.0
Updated: 2018-05-23 04:37:34.0
Pushed: 2017-11-19 23:37:39.0
Size: 20
Language: Go
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
This a lil Golang app that gets a Webhook payload from Nexus Repository Manager 3.1+ and publish to currently:
The primary use case for this app is if you are publishing npm components to Nexus Repository but you also want to publish them to npmjs (and eventually other public repos). You COULD do this as a part of your CI build, but why not use Golang to do it!
To get up and running you'll need Golang and go dep
installed. Once you've done that:
dep ensure
from the rootFrom there you can play around with it, build it, etc…
Right now this is pretty WIP, but you can test it out by:
main.go
for those looking)NEXUS_REPO_BASE_URL
is set to whatever your Nexus Repo instance is, I have it defaulted to how Nexus Repo runs by default (also in main.go
)http://localhost:8000/publish
or wherever this go app will end up runningwebhook/webhook.go
and set your secret key in therego run main.go
npm login
as the user that you will be publishing to npm asNow Nexus Repository Manager should send a webhook over to this service. If the event is for an npm component (what we refer to new packages as), it will shell out to npm and publish it. Assumedly if you wanted to limit this just to a specific repo, some code can be added to do that by checking c.RepositoryName in one of the functions where component is being used.
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:
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:
We stand on the shoulders of giants. Some of the code in this project was graciously borrowed (and attributed to):