mirror of https://github.com/databricks/cli.git
b9406efd27
## Changes This now uses: * libs/cmdio to determine interactivity and perform prompting * libs/databrickscfg to persist the profile It loads a config.Config structure from the environment just like we do for unified authentication. It is therefore possible to specify both the host and token with environment variables. ## Tests ``` pieter.noordhuis@L4GHXDT29P /tmp % export DATABRICKS_CONFIG_FILE=.databrickscfg pieter.noordhuis@L4GHXDT29P /tmp % databricks configure Databricks Host: https://foo.bar Personal Access Token: ***** pieter.noordhuis@L4GHXDT29P /tmp % cat .databrickscfg [DEFAULT] host = https://foo.bar token = token pieter.noordhuis@L4GHXDT29P /tmp % echo token | databricks configure Error: host must be set in non-interactive mode pieter.noordhuis@L4GHXDT29P /tmp % echo token | databricks configure --host foo Error: must start with https:// pieter.noordhuis@L4GHXDT29P /tmp % echo token | databricks configure --host https://foo pieter.noordhuis@L4GHXDT29P /tmp % cat .databrickscfg [DEFAULT] host = https://foo token = token pieter.noordhuis@L4GHXDT29P /tmp % cat .databrickscfg pieter.noordhuis@L4GHXDT29P /tmp % databricks configure --host https://foo Personal Access Token: ****** pieter.noordhuis@L4GHXDT29P /tmp % cat .databrickscfg [DEFAULT] host = https://foo token = token2 ``` |
||
---|---|---|
.. | ||
configure.go | ||
configure_test.go |