diff --git a/{{cookiecutter.project_slug}}/ebsetenv.py b/{{cookiecutter.project_slug}}/ebsetenv.py index fbb8dc2d..ba9652db 100644 --- a/{{cookiecutter.project_slug}}/ebsetenv.py +++ b/{{cookiecutter.project_slug}}/ebsetenv.py @@ -1,5 +1,6 @@ """Converts a .env file to Elastic Beanstalk environment variables""" +import os from sys import exit from subprocess import check_call @@ -10,10 +11,15 @@ except ImportError: exit() def main(): + if not os.path.exists('.env'): + print('ERROR!! .env file is missing!') + print("Please copy 'env.example' to '.env' and add appropriate values") + exit() command = ['eb', 'setenv'] failures = [] for key, value in dotenv.Dotenv('.env').items(): if key.startswith('POSTGRES'): + print('Skipping POSTGRES values - Amazon RDS provides these') continue if value: command.append("{}={}".format(key, value))