Skip to content

Instantly share code, notes, and snippets.

@rodgeraraujo
Created May 17, 2021 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rodgeraraujo/e5a0e4a55a9e7743d22a102fb66e6f9a to your computer and use it in GitHub Desktop.
Save rodgeraraujo/e5a0e4a55a9e7743d22a102fb66e6f9a to your computer and use it in GitHub Desktop.
Python script to read .env and push to heroku app config
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