Created
May 17, 2021 16:17
-
-
Save rodgeraraujo/e5a0e4a55a9e7743d22a102fb66e6f9a to your computer and use it in GitHub Desktop.
Python script to read .env and push to heroku app config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from honcho.environ import parse | |
from invoke import run | |
def push_env(file='.env'): | |
with open(file, 'r') as f: | |
env = parse(f.read()) | |
cmd = 'heroku config:set --app ' | |
for key, value in env.items(): | |
cmd += ' ' + key + "=" + "'"+ value + "'" | |
run(cmd) | |
push_env() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment