diff --git a/hooks/post_gen_project.py b/hooks/post_gen_project.py index 4c14940..e80176c 100644 --- a/hooks/post_gen_project.py +++ b/hooks/post_gen_project.py @@ -64,14 +64,15 @@ files_config_hocon = [ f'{module_dir}/util__hocon.py', f'{module_dir}/res/default.conf', - 'config/debug.conf', + 'config/dev.conf', + 'config/prod.conf', ] files_ci_gitlab = { ".gitlab-ci.yml", } -files_ci_all = files_ci_gitlab +files_ci_all = files_ci_gitlab folders_editor = [ '.idea__editor', @@ -165,7 +166,7 @@ def handle_editor_settings(): def handle_ci(): ci_pipeline = '{{ cookiecutter.ci_pipeline }}' - if ci_pipeline == "gitlab": + if ci_pipeline == "gitlab": _delete_files(files_ci_all - files_ci_gitlab) elif ci_pipeline == 'none': _delete_files(files_ci_all) diff --git a/tests/test_options.py b/tests/test_options.py index 83ed6cf..6783bc5 100644 --- a/tests/test_options.py +++ b/tests/test_options.py @@ -83,7 +83,7 @@ def test_config_hocon(): check_project( settings={'config_file': 'hocon', 'create_cli': 'yes'}, files_existent=['src/{module_name}/util.py', 'src/{module_name}/res/default.conf', - 'config/debug.conf'], + 'config/dev.conf', 'config/prod.conf'], files_non_existent=['config/config.yml'], test_cli=True, run_pytest=True) @@ -92,7 +92,7 @@ def test_config_yaml(): check_project( settings={'config_file': 'yaml'}, files_existent=['src/{module_name}/util.py', 'config/config.yml'], - files_non_existent=['config/debug.conf', 'src/{module_name}/res/default.conf'], + files_non_existent=['config/dev.conf', 'config/prod.conf', 'src/{module_name}/res/default.conf'], run_pytest=True) diff --git a/{{cookiecutter.project_slug}}/config/debug.conf b/{{cookiecutter.project_slug}}/config/dev.conf similarity index 52% rename from {{cookiecutter.project_slug}}/config/debug.conf rename to {{cookiecutter.project_slug}}/config/dev.conf index 5d668c9..e99d3eb 100644 --- a/{{cookiecutter.project_slug}}/config/debug.conf +++ b/{{cookiecutter.project_slug}}/config/dev.conf @@ -1 +1,2 @@ +environment = "dev" logging.level = DEBUG diff --git a/{{cookiecutter.project_slug}}/config/prod.conf b/{{cookiecutter.project_slug}}/config/prod.conf new file mode 100644 index 0000000..23a817b --- /dev/null +++ b/{{cookiecutter.project_slug}}/config/prod.conf @@ -0,0 +1 @@ +environment = "prod"