Skip to content

Commit

Permalink
Use dev and prod configs instead of debug for hocon option
Browse files Browse the repository at this point in the history
  • Loading branch information
Carsten Böhm committed Aug 20, 2021
1 parent a2be069 commit 719c6da
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
7 changes: 4 additions & 3 deletions hooks/post_gen_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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)


Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
environment = "dev"
logging.level = DEBUG
1 change: 1 addition & 0 deletions {{cookiecutter.project_slug}}/config/prod.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
environment = "prod"

0 comments on commit 719c6da

Please sign in to comment.