Closed madslyng closed 3 months ago
Thanks for creating the issue.
It is possible to specify template variables in a configuration file (with a JSON key/value map).
The flag for this is --config-file
.
@madslyng I'll close this issue since the --config-file
flag already exists and should satisfy your use case. Please feel free to reopen the issue in case there's a gap not addressed by the flag for your use case.
Describe the issue
Use-case: Create a new bundle based on a custom template, programmatically, where the user is not prompted for input.
We are attempting to automate bundle creation using the CLI. Specifically we are trying generate a new bundle in an existing repository, using an auto-generated name, that the generated bundle should use.
For instance if the template expects:
.project_name
, then we currently don't see a way where we can rundatabricks bundle init git@github.com:repo_name/poc-bundle-templates.git --template-dir poc-template --output-dir="./bundles"
, where the user doesn't get asked questions via a prompt.That makes automation much more complicated as far as we can see.
Steps to reproduce the behavior
Please list the steps required to reproduce the issue, for example:
databricks bundle init git@github.com:repo_name/poc-bundle-templates.git --template-dir poc-template --output-dir="./bundles"
Expected Behavior
CLI command that accepts vars to be injected into the template upon execution of the command. For instance:
databricks bundle init git@github.com:repo_name/poc-bundle-templates.git --template-dir poc-template --output-dir="./bundles" --template-var="project_name=monkey"
Actual Behavior
Always asks user for input
Is this a regression?
No.
Debug Logs
─$ databricks bundle init git@github.com:repo_name/poc-templates.git --template-dir poc-template --output-dir="./bundles"
User prompt: