Skip to content

Commit

Permalink
* [BUGFIX][#174] allow j2 file extension in deployment
Browse files Browse the repository at this point in the history
* [BUGFIX][#174] allow j2 file extension in deployment
  • Loading branch information
elenamartina authored Mar 1, 2022
1 parent e01a7c5 commit 743b579
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
> And empty the **[Unreleased]** section above.
----

## [0.4.1] - 2022-03-01

## Fixed

- Jinja2-based file recognition behaviour

## [0.4.0] - 2022-02-28

### Added
Expand Down
2 changes: 1 addition & 1 deletion dbx/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.0"
__version__ = "0.4.1"
7 changes: 6 additions & 1 deletion dbx/commands/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,13 @@ def finalize_deployment_file_path(deployment_file: Optional[str]) -> str:
if deployment_file:
file_extension = deployment_file.split(".").pop()

if file_extension == "j2":
file_extension = deployment_file.split(".")[-2]
if file_extension not in ["json", "yaml", "yml"]:
raise Exception('Deployment file should have one of these extensions: [".json", ".yaml", ".yml"]')
raise Exception(
"Deployment file should have one of these extensions:"
'[".json", ".yaml", ".yml", "json.j2", "yaml.j2", "yml.j2"]'
)

if not pathlib.Path(deployment_file).exists():
raise Exception(f"Deployment file ({deployment_file}) does not exist")
Expand Down

0 comments on commit 743b579

Please sign in to comment.