Skip to content
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

Allow getting access token from environment variable #26

Closed
whmountains opened this issue May 3, 2017 · 1 comment
Closed

Allow getting access token from environment variable #26

whmountains opened this issue May 3, 2017 · 1 comment

Comments

@whmountains
Copy link

- Do you want to request a feature or report a bug?
Request a feature

- What is the current behavior?
The CLI gets it's access token from ~/.netlify/config. This can be overridden with the --access-token flag.

- What is the desired behavior?
It would be helpful if the access token could be set with an environment variable.

Why? Because on the CI server, the config file won't be available so you need other means of passing the access token. I can use the cli flag, --access-token $NETLIFY_TOKEN but that means my build script will fail when running locally because the environment variable won't be available.

- Please mention your node.js, and operating system version.
Not relevant.

@fool
Copy link
Contributor

fool commented Aug 10, 2017

Development on netlify-cli by netlify is basically over - all effort going into netlifyctl these days. However as a workaround, how about if in CI you did something like this?

if [ ! -z "$ACCESS_TOKEN" ] ; then
  netlify deploy --access-token $NETLIFY_TOKEN
else
  netlify deploy
fi

This has the added benefit that you can just turn off netlify deploy entirely by replacing the else clause for local development.

If that feels too dirty to you, we'll still accept PR's to add features to netlify-cli.

@fool fool closed this as completed Aug 10, 2017
bcomnes added a commit that referenced this issue Aug 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants