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

Add helper script to setup envvars via envchain #399

Merged
merged 1 commit into from
May 23, 2022
Merged

Conversation

annawinkler
Copy link
Contributor

@annawinkler annawinkler commented May 10, 2022

Description

Add a helper script to simplify setting env vars via envchain. Script prompts for an envchain workspace name, then invokes envchain with the environment variables.

Testing plan

  1. Pull this branch
  2. Run ./scripts/setup-test-envvars.sh
  3. If you don't have envchain, the script will exit and request that it be installed via homebrew (this part could be more generic).
  4. If you do have envchain, the script prompts for an envchain workspace name, then calls envchain with that workspace name and these 4 envvars: TFE_ADDRESS TFE_TOKEN GITHUB_TOKEN GITHUB_POLICY_SET_IDENTIFIER

Output from tests (HashiCorp employees only)

$ TFE_ADDRESS="https://example" TFE_TOKEN="example" TF_ACC="1" go test ./... -v -tags=integration -run TestFunctionsAffectedByChange

...

@annawinkler
Copy link
Contributor Author

If we like this script, I can update the testing docs to reference the script.

Copy link
Collaborator

@uturunku1 uturunku1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consider alternative solutions to envchain? A concern we have that this script is customized to a very specific tool and other may not end up using this script because everyone ends using their own alternative solution.

Copy link
Contributor

@sebasslash sebasslash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I won't hit approve cause I'm assuming you're going to address some changes requested by @uturunku1 (so it will dismiss my approval anyways) -- I like the idea of this script, thank you for this 👍

Once they're addressed, everything looks good to me ✅

@annawinkler annawinkler merged commit ec7bbc6 into main May 23, 2022
@annawinkler annawinkler deleted the aw/setup-envvars branch May 23, 2022 18:27
@github-actions
Copy link

Reminder to the contributor that merged this PR: if your changes have added important functionality or fixed a relevant bug, open a follow-up PR to update CHANGELOG.md with a note on your changes.

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

Successfully merging this pull request may close these issues.

4 participants