From d82904aafe39cb26136bc6242bf03ec7a4c20a4f Mon Sep 17 00:00:00 2001 From: Corey Oordt Date: Fri, 19 Jul 2019 13:30:56 -0500 Subject: [PATCH] Moved merge_production_dotenvs_in_dotenv to the bin directory. --- .gitignore | 5 ----- docs/developing-locally-docker.rst | 2 +- hooks/post_gen_project.py | 2 +- {{cookiecutter.project_slug}}/.gitignore | 5 ----- .../{ => bin}/merge_production_dotenvs_in_dotenv.py | 2 +- 5 files changed, 3 insertions(+), 13 deletions(-) rename {{cookiecutter.project_slug}}/{ => bin}/merge_production_dotenvs_in_dotenv.py (96%) diff --git a/.gitignore b/.gitignore index 54fafb8be..cd044f70a 100644 --- a/.gitignore +++ b/.gitignore @@ -211,11 +211,6 @@ tags ### VirtualEnv template # Virtualenv # http://iamzed.com/2009/05/07/a-primer-on-virtualenv/ -[Bb]in -[Ii]nclude -[Ll]ib -[Ll]ib64 -[Ss]cripts pyvenv.cfg pip-selfcheck.json diff --git a/docs/developing-locally-docker.rst b/docs/developing-locally-docker.rst index 09e684986..068b515e8 100644 --- a/docs/developing-locally-docker.rst +++ b/docs/developing-locally-docker.rst @@ -118,7 +118,7 @@ The three envs we are presented with here are ``POSTGRES_DB``, ``POSTGRES_USER`` One final touch: should you ever need to merge ``.envs/production/*`` in a single ``.env`` run the ``merge_production_dotenvs_in_dotenv.py``: :: - $ python merge_production_dotenvs_in_dotenv.py + $ ./bin/merge_production_dotenvs_in_dotenv.py The ``.env`` file will then be created, with all your production envs residing beside each other. diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index ff84f1806..ed762b40f 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -267,7 +267,7 @@ def set_flags_in_settings_files(): def remove_envs_and_associated_files(): shutil.rmtree(".envs") - os.remove("merge_production_dotenvs_in_dotenv.py") + os.remove(os.path.join("bin", "merge_production_dotenvs_in_dotenv.py")) def remove_celery_compose_dirs(): diff --git a/{{cookiecutter.project_slug}}/.gitignore b/{{cookiecutter.project_slug}}/.gitignore index cb8ad8358..c273d716f 100644 --- a/{{cookiecutter.project_slug}}/.gitignore +++ b/{{cookiecutter.project_slug}}/.gitignore @@ -325,11 +325,6 @@ tags ### VirtualEnv template # Virtualenv -[Bb]in -[Ii]nclude -[Ll]ib -[Ll]ib64 -[Ss]cripts pyvenv.cfg pip-selfcheck.json .env diff --git a/{{cookiecutter.project_slug}}/merge_production_dotenvs_in_dotenv.py b/{{cookiecutter.project_slug}}/bin/merge_production_dotenvs_in_dotenv.py similarity index 96% rename from {{cookiecutter.project_slug}}/merge_production_dotenvs_in_dotenv.py rename to {{cookiecutter.project_slug}}/bin/merge_production_dotenvs_in_dotenv.py index 4e70e2adb..e5865fe28 100644 --- a/{{cookiecutter.project_slug}}/merge_production_dotenvs_in_dotenv.py +++ b/{{cookiecutter.project_slug}}/bin/merge_production_dotenvs_in_dotenv.py @@ -3,7 +3,7 @@ from typing import Sequence import pytest -ROOT_DIR_PATH = os.path.dirname(os.path.realpath(__file__)) +ROOT_DIR_PATH = os.path.dirname(os.path.dirname(os.path.realpath(__file__))) PRODUCTION_DOTENVS_DIR_PATH = os.path.join(ROOT_DIR_PATH, ".envs", ".production") PRODUCTION_DOTENV_FILE_PATHS = [ os.path.join(PRODUCTION_DOTENVS_DIR_PATH, ".django"),