-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for installing the CLI on DBR (#85)
We want to install the CLI at $HOME/bin when the `install.sh` installation script is invoked from DBR. This allows us to provide the CLI in DBR though a proxy trampoline script that's installed in DBR at `/usr/local/bin`. This PR also adds a couple of tests and assertions to make this functionality robust for use in DBR.
- Loading branch information
1 parent
216cac9
commit c55718d
Showing
5 changed files
with
132 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
# Assert databricks CLI is not already installed | ||
if which databricks >/dev/null 2>&1; then | ||
exit 1 | ||
else | ||
exit 0 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
EXPECTED="${1:-invalid}" | ||
ACTUAL=$(which databricks) | ||
|
||
if [[ "$EXPECTED" != "$ACTUAL" ]]; then | ||
echo "Path \"$ACTUAL\" does not match expectation \"$EXPECTED\"." | ||
exit 1 | ||
else | ||
echo "Path \"$ACTUAL\" matches expectation." | ||
exit 0 | ||
fi |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters