-
-
Notifications
You must be signed in to change notification settings - Fork 0
Creating Environment Variables
Yash Totale edited this page Mar 5, 2021
·
8 revisions
Creating new environment variables is a multi-step process as secret variables are stored as environment variables, forcing us to git ignore our .env file.
- Make sure that the variable(s) you are adding does not already exist in the
.envfile - If it doesn't already exist, add the variable(s) to the end of the
.envfile in the format<VARIABLE_NAME>=<value>(Ex.EXAMPLE_VAR=testing) - Update
.env.examplewith the name of your new variable(s) in the format<VARIABLE_NAME>=(Ex.EXAMPLE_VAR=) - Keep in mind that the
.envfile is NOT supposed to be committed, while the.env.examplefile is
For others to access your new variable(s) when setting up their dev environment, you need to update the shared .env file in Google Drive
- Login to Google Drive with [email protected]
- Navigate to the 'Secret Files' folder inside of the 'Development' folder in the 'Feedback Survey Automation' folder in Drive
- Replace the
.envfile with your local copy
- Replace the
- If your new environment variable(s) is needed for production runs, navigate to the Production 'Secret Files' folder inside of the 'Production' folder in the 'Feedback Survey Automation' folder in Drive
- Replace the
.envfile with your local copy (Make sure your.envfile has been updated with existing production environment variables first!)
- Replace the
Many of the GitHub Workflows need access to the environment variables defined in .env. Be sure to update the DEV_ENV secret and, if needed, the PROD_ENV secret with your new environment variable(s).
Posting a message on the Hack4Impact Slack channel will notify others that they need to update their .env files with the new variable(s).
Created by Yash Totale & Subha Das
© 2021 Hack4Impact