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 setting token via environment variable for spin cloud deploy #103

Open
rajatjindal opened this issue Feb 16, 2023 · 4 comments
Open

Comments

@rajatjindal
Copy link
Contributor

it will be useful to support setting an env variable which can be consumed by spin cloud deploy to do the deployment.

@rajatjindal rajatjindal changed the title allow setting token via environment variable for spin cloud deploy allow setting token via environment variable for spin cloud deploy Feb 16, 2023
@vdice
Copy link
Member

vdice commented Feb 16, 2023

Can you elaborate on the use case @rajatjindal? Perhaps for scenarios where the spin cloud login action to Fermyon Cloud has been done separate from the current environment (i.e. the json config wouldn't be present locally at spin cloud deploy time?)

Question on precedence: If the env var is non-empty, I'm assuming its value should take precedence over the token stored in the json config, if exists, for the current deployment environment?

@rajatjindal
Copy link
Contributor Author

Can you elaborate on the use case @rajatjindal? Perhaps for scenarios where the spin cloud login action to Fermyon Cloud has been done separate from the current environment (i.e. the json config wouldn't be present locally at spin cloud deploy time?)

yes, precisely that. if we have a cloud token, we should be able to use that directly without having to write it to a file in a specific format.

Question on precedence: If the env var is non-empty, I'm assuming its value should take precedence over the token stored in the json config, if exists, for the current deployment environment?

yes, I would think so too.

on the other hand, if we want to introduce a flag --token instead of environment variable, that works too.

@lann
Copy link
Collaborator

lann commented Feb 17, 2023

You'd need an env var for server URL (and arguably "danger_accept_invalid_certs") too, wouldn't you? I wonder if we'd be better off adding a --token opt to spin cloud login to update the credentials file.

@endocrimes
Copy link
Member

I'd be a big proponent of adding env vars over requiring we write config to a fixed file - esp for CI/CD Workflows where you probably wanna pull those from "some" kind of secret store

@michelleN michelleN transferred this issue from fermyon/spin Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Investigating / Open for Comment
Development

No branches or pull requests

4 participants