databricks-cli/libs
Pieter Noordhuis b9406efd27
Update configure command (#482)
## 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
```
2023-06-15 12:50:19 +00:00
..
auth Add profile on `databricks auth login` (#423) 2023-06-02 13:49:39 +02:00
cmdio Update configure command (#482) 2023-06-15 12:50:19 +00:00
databrickscfg Include [DEFAULT] section header when writing ~/.databrickscfg (#464) 2023-06-13 16:41:56 +00:00
errs Added ability for deferred mutator execution (#380) 2023-05-16 18:01:50 +02:00
filer Add workspace import-dir command (#456) 2023-06-12 21:03:46 +02:00
fileset Don't sync symlink folders (#205) 2023-02-15 17:02:54 +01:00
flags Add mode default as a valid set value for progress-format flag (#472) 2023-06-14 13:26:56 +02:00
git Fix tests for new repository name (#390) 2023-05-16 19:02:07 +02:00
locker Rename bricks -> databricks (#389) 2023-05-16 18:35:39 +02:00
log Rename bricks -> databricks (#389) 2023-05-16 18:35:39 +02:00
notebook Error out if notebook file does not exist locally (#261) 2023-03-21 18:13:16 +01:00
sync Add directory tracking to sync (#425) 2023-06-12 11:44:00 +00:00
terraform Add bundle destroy command (#300) 2023-04-06 12:54:58 +02:00
testfile Refactor and cover edge cases in sync integration tests (#160) 2023-01-10 13:16:30 +01:00