teambit / bit

A build system for development of composable software.
https://bit.dev
Other
17.83k stars 924 forks source link

How to setup bit server docker with Verdaccio #2632

Closed nvthuong1996 closed 3 years ago

nvthuong1996 commented 4 years ago

I found the installation guide package registry in https://docs.bit.dev/docs/bit-server#package-registry but it's not clear for me to follow suit

GiladShoham commented 4 years ago

Can you describe what exactly you are trying to achieve? Anyway, we are going to make this much easier soon.

wwwikies commented 4 years ago

You can set up your own server for components collaboration, or use the bit.dev cloud ... how to set up my own server? Does any doc show details ? thx~~

itaymendel commented 4 years ago

hi @wwwikies it's right there in the docs :) https://docs.bit.dev/docs/bit-server

nvthuong1996 commented 4 years ago

Search and npm / yarn install are only available for components exported to bit.dev. i want search my component via npm and i want to use Verdaccio. how i setup bit server with Verdaccio in docker. when component export to server it auto publish to Verdaccio

GiladShoham commented 4 years ago

You can take a look at our e2e tests that does exactly this. We are starting a verdaccio server and publish components to it. take a look specifically on this function: https://github.com/teambit/bit/blob/prod/e2e/npm-ci-registry.ts#L120 And search in the e2e folder for the usage of this function. Soon we will have a formal "publish" extension that will make this entire process much much easier.

nvthuong1996 commented 4 years ago

if possible I want the bit server to automatically publish the component . rather than manually publishing via client bit. I am trying to read the bit source. I still don't know how to do that.

nvthuong1996 commented 4 years ago

How can I put a trigger on a bit-server when a component is exported to scope --bare

GiladShoham commented 4 years ago

@nvthuong1996 You should use the post-recieve-objects hook on your server read more here: https://docs.bit.dev/docs/ext-developing-extensions.html#registering-an-action-to-a-hook Here is a real example from our own bit.dev server, that registers to this hook and sends an API call to another service - https://bit.dev/bit/extensions/defaults/webhooks/~code Keep in mind, that in the upcoming release, this might be broken since we are going to replace it with a much better way to do it.

nvthuong1996 commented 4 years ago

thank you

gregoryrpitts commented 4 years ago

@GiladShoham Thanks for your explanations. I'm considering implementing this, but would like to know if there is a timeline for the "upcoming release" you mentioned and whether or not it's worth going through the process knowing that you may break the functionality and provide a "publish extension".

GiladShoham commented 4 years ago

@gregoryrpitts The new version is coming very soon (closed beta in the next few days). Can you describe what exactly you want to achieve?

gregoryrpitts commented 4 years ago

Sure. I'm looking to publish Bit components to a privately hosted NPM registry, similar to what is mentioned in the docs. Verdaccio is what I'm thinking, their docker solutions are nice.

Then I want to be able to to include bit components in various ReactJS projects through @gregoryrpitts/component in my package.json file, just like I can if I use bit.dev. I'll do most of my component modifications through one "library" project and then distribute to many other react projects within the org...aka I don't need "decentralized" component publishing I'll only be publishing from that one "library" project.

I don't care so much about the UI of bit.dev since my one "library" project has it's own storybook and I'm not really clear on what the CI piece of bit.dev does. I'm part of a cost conscious startup so if I can just setup and use the open source Bit I think it's a better value.

But yea if everything is going to break or if there is an easier implementation coming out soon then I'll wait. I haven't even looked into the e2e source code yet. I'd be willing to help in the beta also if it would help my use case. I'm a new user of bit.dev (just started playing around and prototyping this week) so I'm a relatively fresh set of eyes.

Temmermans commented 4 years ago

Looking forward to the new release as well!

itaymendel commented 3 years ago

We'll start rolling out v15 of Bit this week, please reach out to me privately on the public slack community for a sneak peek and getting early access to it.