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

Ability to modify environment variables for the exec subcommand #37

Open
psibi opened this issue Oct 23, 2024 · 3 comments
Open

Ability to modify environment variables for the exec subcommand #37

psibi opened this issue Oct 23, 2024 · 3 comments

Comments

@psibi
Copy link
Member

psibi commented Oct 23, 2024

I recently had this usecase where I wanted to store multiple similar keys but for test and staging environment:

amber encrypt GH_TOKEN_DEV redacted
amber encrypt GH_TOKEN_STAGING redacted

My usecase is that I want to execute this via amber exec. But at runtime, I want to change the environment variable appropriately before executing. In the above case, I want to change the environment variable to GH_TOKEN on the appropriate environment before executing.

I was thinking something like this:

amber exec --rename-env GH_TOKEN_DEV=GH_TOKEN -- gh release download

Any objections to have this feature ? I can volunteer to implement the same if there are no objections.

@snoyberg
Copy link
Member

That looks totally reasonable, sounds great. Only other thought: should we introduce some method to have different potential values for each environment variable? The only term I can think of is introducing environments, which is a confusing term. But what I mean is having something like:

GH_TOKEN_DEV:
    dev: DEADBEEF1
    staging: DEADBEEF2

And then:

amber exec --environment dev -- gh release download

I'd want to use a different term than environment if we can think of one. I'm not sure if I like this more or less than your proposal TBH, just brainstorming.

@psibi
Copy link
Member Author

psibi commented Oct 23, 2024

Interesting idea and I think it's nice. I have to think about this a bit more to see how it fits with the other workflow, let me get back to you on this.

I'd want to use a different term than environment if we can think of one.

Probably PROFILE ?

@snoyberg
Copy link
Member

Probably PROFILE ?

Perfect!

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