Giter Club home page Giter Club logo

deploy-env's People

Contributors

pytal avatar renovate-bot avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

remorses

deploy-env's Issues

Handle Too many requests

Hi,

When adding a lot of env variables, I get rate limited by Vercel. However, it is currently not detected and eventually the command fails. Maybe detect & sleep for x seconds? Thanks!

Added Environment Variable NUXT_ENV_RECAPTCHA_KEY to Project umsfront [2s]
Error! Too many requests - try again in 46 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 46 seconds (more than 120, code: "api-projects"). (429)
/bin/sh: -c: line 1: syntax error: unexpected end of file
/bin/sh: -c: line 0: `echo -n (xxxxx) | vercel env add NUXT_ENV_HOME_LEGAL production'
Error! Too many requests - try again in 46 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 45 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 46 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 46 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 45 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 45 seconds (more than 120, code: "api-projects"). (429)
/bin/sh: more!: command not found
Vercel CLI 19.1.1
Error! Too many requests - try again in 44 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 43 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 43 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 43 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 43 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 43 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 43 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 43 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 41 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 41 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 41 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 41 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 41 seconds (more than 120, code: "api-projects"). (429)
/bin/sh: more!: command not found
Vercel CLI 19.1.1
Error! Too many requests - try again in 41 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 41 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 41 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 39 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 38 seconds (more than 120, code: "api-projects"). (429)
/bin/sh: More!: command not found
Vercel CLI 19.1.1
Error! Too many requests - try again in 38 seconds (more than 120, code: "api-projects"). (429)
groups.: No such file or directory
Vercel CLI 19.1.1
Error! Too many requests - try again in 38 seconds (more than 120, code: "api-projects"). (429)
Error! Too many requests - try again in 38 seconds (more than 120, code: "api-projects"). (429)

Error: Cannot find module 'fs/promises'

Hi,

Thanks for your package.

Using node v12.18.2, I get this error;

w@Williams-MacBook-Pro umsFront % deploy-env
internal/modules/cjs/loader.js:969
throw err;
^

Error: Cannot find module 'fs/promises'
Require stack:

  • /usr/local/lib/node_modules/deploy-env/lib/helpers/helpers.js
  • /usr/local/lib/node_modules/deploy-env/lib/utils/vercel-env.js
  • /usr/local/lib/node_modules/deploy-env/lib/cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
    at Function.Module._load (internal/modules/cjs/loader.js:842:27)
    at Module.require (internal/modules/cjs/loader.js:1026:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object. (/usr/local/lib/node_modules/deploy-env/lib/helpers/helpers.js:1:135)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Module.require (internal/modules/cjs/loader.js:1026:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/usr/local/lib/node_modules/deploy-env/lib/helpers/helpers.js',
    '/usr/local/lib/node_modules/deploy-env/lib/utils/vercel-env.js',
    '/usr/local/lib/node_modules/deploy-env/lib/cli.js'
    ]
    }

deploy-env is trimming env

I'm using a .env file, but if a env var have spaces, deploy-env trims them.

For example this env:
SOME_ENV=Some Important Env
Would translate to SomeImportantEnv when using deploy-env.

Is there a way to fix that? I've already tried using quotes, but it didn't work.

Release v3.0

  • Publish to npm
  • Update GitHub release notes
  • ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: undefined. Note: this is a nested preset so please contact the preset author if you are unable to fix it yourself.

Use esbuild

  • Jest
    - Running scripts
    • Use sucrase for running scripts as esbuild doesn't have a drop-in node replacement

Test CLI

  • Test CLI locally
  • Test CLI installed from npm

Not working with Vercel CLI 23.0.1

Thanks a lot for this tool, I would like to use it with the latest vercel CLI. I am getting the following error:

Error! Environment Variable was not found.
Error! The Environment "API_URL" is invalid. It must be one of: <production | preview | development>.

Looking at the code, the issue come from a change in the vercel cli. Older CLI has:

 Vercel CLI 21.0.0
 vercel env [options] <command>
 add     [type] [name] [environment]     Add an Environment Variable (see examples below)

New CLI has:

Vercel CLI 23.0.1
vercel env [options] <command>
add     [name] [environment] [gitbranch]  Add an Environment Variable (see examples below)

which means [type]has been removed ([gitbranch]has been added).

Could you please update this project to the latest CLI version?

Allow passing vercel access token with `-t` and `--token`

Is your feature request related to a problem? Please describe.
To be able to use this cli in Github actions or other CI solutions you need to pass the --token option with your vercel access token to the vercel cli

Describe the solution you'd like
Add a -t or --token option that is forwarded to the vercel cli

Describe alternatives you've considered

Additional context

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update actions/setup-node action to v4
  • Update dependency eslint to v9
  • Update dependency eslint-config-prettier to v9
  • Update dependency p-limit to v5
  • Update dependency prettier to v3
  • Update dependency vercel to v34
  • Update pnpm to v9
  • Update pnpm/action-setup action to v4
  • Update softprops/action-gh-release action to v2
  • Update typescript-eslint monorepo to v7 (major) (@typescript-eslint/eslint-plugin, @typescript-eslint/parser)
  • ๐Ÿ” Create all rate-limited PRs at once ๐Ÿ”

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v2
  • pnpm/action-setup v2.4.0
  • actions/setup-node v2
.github/workflows/release.yml
  • actions/checkout v2
  • pnpm/action-setup v2.4.0
  • actions/setup-node v2
  • softprops/action-gh-release v1
npm
package.json
  • env-cmd ^10.1.0
  • p-limit ^4.0.0
  • @types/jest ^27.5.2
  • @types/node ^12.20.55
  • @typescript-eslint/eslint-plugin ^5.59.7
  • @typescript-eslint/parser ^5.59.7
  • esbuild ^0.14.3
  • esbuild-jest ^0.5.0
  • eslint ^8.41.0
  • eslint-config-prettier ^8.8.0
  • jest ^27.5.1
  • prettier ^2.8.8
  • sucrase ^3.32.0
  • terser ^5.17.6
  • typescript ^4.9.5
  • vercel ^23.0.0
  • node >=v12.22.12
  • pnpm >=6.35.1

  • Check this box to trigger a request for Renovate to run again on this repository

Add code formatter and linter

  • Prettier
    • Configure
    • Format code
    • Format non-code files
    • Add workflow checks for CI
  • ESLint
    • Configure
    • Fix lint errors
    • Add workflow checks for CI
  • Integrate Prettier and ESLint

Error while executing cmd

Hi, I'm having the following error while executing deploy-env production:

(node:19829) UnhandledPromiseRejectionWarning: Error: Failed to find .rc file at default paths: [./.env-cmdrc,./.env-cmdrc.js,./.env-cmdrc.json]
at getRCFile (/home/guizz/.nvm/versions/node/v14.4.0/lib/node_modules/deploy-env/node_modules/env-cmd/dist/get-env-vars.js:108:11)
at async Object.exports.getEnvVarMap (/home/guizz/.nvm/versions/node/v14.4.0/lib/node_modules/deploy-env/lib/utils/get-env.js:1:386)
at async Object.exports.deployEnv (/home/guizz/.nvm/versions/node/v14.4.0/lib/node_modules/deploy-env/lib/utils/vercel-env.js:1:622)

stuff being added to env-vars on mac

I use this tool on linux and it works great. I generate a .env.preview file then run deploy-env preview and it sets up all the vars correctly.

A co-worker uses mac, and whenever they run same command, they get a generated env file that looks correct, but after it's deployed, I get errors in the vercel log that point me to believing it's a bad env-var. I tried it on my own mac (with the same code) and it had a similar issue. it appears to be adding -n and \n to the var. I made an endpoint to dump the env-vars as json, and they look like this:

{
  "SOME_VAR": "-n MYVALUE\n"
}

when it should be:

{
  "SOME_VAR": "MYVALUE"
}

My .env.preview looks like this:

SOME_VAR=MYVALUE

Delete Environment Variables / add to multiple at once

Great package!

It would be great to add functionality to remove selected or all variables and to allow for multiple environments at once.

I.e.ย 

deploy-env delete or deploy-env delete [name of variable]
deploy-env --environment production preview development --var [name of variable]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.