From d31e86fc8ace6e273cc19271139f9ac52d3db085 Mon Sep 17 00:00:00 2001 From: Daniel Roy Greenfeld Date: Mon, 26 Sep 2016 09:28:35 -0700 Subject: [PATCH] Now includes message for missing .env file. Fixed #819 --- {{cookiecutter.project_slug}}/ebsetenv.py | 6 ++++++ 1 file changed, 6 insertions(+) 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))