Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

always render source section in secrets.toml, even if there are no secrets, add gitignore to output #111

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions dlt_init_openapi/renderer/default/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ def _build_meta_files(self) -> None:
encoding=FILE_ENCODING,
)

gitignore_template = self.env.get_template("gitignore.j2")
gitignore_path = self.config.project_dir / ".gitignore"
gitignore_path.write_text(
gitignore_template.render(),
encoding=FILE_ENCODING,
)

def _create_package(self) -> None:
self.config.project_dir.mkdir(exist_ok=True, parents=True)
self.package_dir.mkdir(exist_ok=True)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{% if credentials %}
[sources.{{project_name}}]
# secrets for your {{project_name}} source
{% if credentials %}
{% for secret in credentials.detected_secret_names %}
{{ secret }} = "FILL ME OUT" # TODO: fill in your credentials
{% endfor %}
{% else %}
# example_api_key = "example value"
{% endif %}
4 changes: 4 additions & 0 deletions dlt_init_openapi/renderer/default/templates/gitignore.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# local duckdb files
*.duckdb
# pipeline secrets
secrets.toml
Loading