databricks / cli

Databricks CLI
Other
129 stars 48 forks source link

databricks bundle --template-dir does not work #1628

Closed gvlpedro closed 1 month ago

gvlpedro commented 1 month ago

Describe the issue

command 'databricks bundle init' does not work with --template-dir

Steps to reproduce the behavior

Please list the steps required to reproduce the issue, for example:

  1. Create your template

image

  1. Execute command from external path:
databricks bundle init --template-dir ./project/job-bundle-template/ -p MYPROFILE --output-dir new-project

Expected Behavior

I expect the prompt ask me about the params needed to create the new bundle, I also tried to pass --config-file with key-value but it does not work.

Actual Behavior

Prompt ask me about the template ¿?

Search: █
? Template to use: 
  default-python (The default Python template for Notebooks / Delta Live Tables / Workflows)
  default-sql
  dbt-sql
  mlops-stacks
  custom...

OS and CLI version

MacOS sonoma 14.5, cli version:0.222

Is this a regression?

I dont know

Debug Logs

Not relevant logs when I use --debug

shreyas-goenka commented 1 month ago

Hi @gvlpedro, thanks for reaching out. To initialize a local template you can simply run

databricks bundle init [local-path-to-template]

The template-dir flag is meant to be used if you specify a Git URL as the template path, in that case the flag helps you select a subdirectory from the Git repo root.

I'll close this issue since the feature works as expected.