-
Notifications
You must be signed in to change notification settings - Fork 924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Bit with Zeit Now #1756
Comments
Hi,
I have also found this blog post about Zeit's build env feature. From reading this, I assume that you can configure the This is how we configure the
You should be able to configure it through the |
Unfortunately, I'm not using a dockerfile I'm using Zeit's @now/next builder. |
Kindly take a look at the documentation here. |
Hi @paulogdm Yes this is something that I already use as I have a private npm repo! But Bit requires a private npm registry to be added not a private repo |
My apologies for the confusion. |
Do you have any workarounds as this has just stopped all progress |
A very hacky solution would be to use a |
Thanks, @paulogdm Any chance of an ETA? |
Not a priority at the moment, since we are focused on other features. So I would say it is at least a couple of months away. |
Ok I'm am using the following shell script #! /bin/bash
echo "Adding Bit Registery"
echo "@bit:registry=https://node.bit.dev" >> .npmrc
echo "//node.bit.dev/:_authToken={$BIT_NODE_TOKEN}" >> .npmrc Which runs and the BIT_NODE_TOKEN was taken from my dev pc's
|
Do you have any idea or a way to validate where the You can try and create it in the home dir of the account (
Additionally, do you use yarn or npm to fetch dependencies?
|
Returns this
|
I have tried both
Output
|
This is the
@paulogdm Do you have any thoughts? |
Let me relay this one. |
The Today, there is an environment variable, NPM_TOKEN, that can can be used to install private npm packages published to npmjs.org but this does not change the registry URL. @williamluke4 If there was support for a new environment variable, something like |
@styfle I don't think this would solve the issue as it is a scoped registry (@itaymendel Correct me if I'm wrong). I think the best option, for now, would be to expose the |
@styfle @williamluke4 specifically for Bit's case it should work, as Bit's registry is also a proxy for npmjs.org... so in case a package is missing in BIt, it falls back to npmjs.org. I'm not sure how many teams that want to use Zeit use both a private package registry (using jfrog or verdaccio for example), or even use services like fort-awesome... and need an ability to fetch components from several repositories. So perhaps this is something to consider. |
If you were to expose the |
@styfle Any chance you have a workaround as this has halted development |
It seems like the best solution would be to provide a way for users to define the contents of How does that sound? |
I implemented this feature. In order to add the secret, you can do the following:
Then you'll need to link the secret to the environment variable {
"version": 2,
"builds": [
{ "src": "index.js", "use": "@now/node" }
],
"build": {
"env": {
"NPM_RC": "@my-app-npmrc"
}
}
} I prefix my secrets with the app name but you can change However, the env var name, |
From the looks of it Zeit now support installing packages from Bit and all other non-nmpjs registries! |
@styfle @itaymendel Is this the correct way to use this or am I missing somthing?
|
It’s probably best to put the contents in a file instead of dealing with escape sequences in bash. My example above assumes that your .npmrc file works locally with Bit and you want to add to ZEIT Now secrets. |
@styfle @itaymendel Thanks for all the help guys! I got it working, it's not pretty but it works :) |
awesome! |
Steps
Notes
now secrets add npmrc "//registry.npmjs.org/:_authToken=YOUR_NPM_TOKEN\n@bit:registry=https://node.bit.dev\n//node.bitsrc.io/:_authToken=YOUR_BIT_TOKEN\n//node.bit.dev/:_authToken=YOUR_BIT_TOKEN" now.json {
"name": "bit",
"version": 2,
"builds": [{
"src": "next.config.js",
"use": "@now/next"
}],
"build": {
"env": {
"NPM_RC": "@npmrc"
}
}
} |
I am using verdaccio, and can't seem to get this to work with I have this in now.json: {
"version": 2,
"builds": [
{
"src": "package.json",
"use": "@now/static-build"
}
],
"routes": [],
"env": {},
"build": {
"NPM_RC": "@npmrc"
}
} I have set the secret with this:
I also added it to
Where Just to test, I tried adding the same to my now.json, which also couldn't find the module. With my regular .npmrc, the project works fine, outside of now. Am I missing something? |
Hmm, maybe I screwed something up. just rebuilt the private-npm module in question, double-checked to make make sure it worked outside of now, and set the project up from scratch, and it worked ok with |
There are docs about Zeit in bit's docs here - https://docs.bit.dev/docs/ci#zeit |
With verdaccio, I have a huge token that causes this error:
We are using gitlab auth integration, and it looks like my token is a giant JWT from there. I will look into getting a smaller verdaccio auth token. I guess this is all very unrelated to bit, though. |
@konsumer |
Thanks! I ended up just putting a |
Does anyone know how to install public/private components when deploying to Zeit Now.
This is the Error I'm getting as I don't know how to add the bit npm registry
The text was updated successfully, but these errors were encountered: