Initial Azure SSH work; login and installer #139
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR represents the start of work on Azure SSH in the P0 CLI. It adds a basic shell of an
azureSshProvider
that is the bare minimum needed to start development work, and implements automated installers for both Homebrew (required for installing the Azure CLI on macOS) and the Azure CLI (az
) itself, and a simple call toaz login
to log in to Azure whenp0 ssh --provider azure
is invoked.Testing requires rebasing this branch on the
azure-ssh-dev-base
branch (or cherry-picking that branch on top of this one), which contains the scaffolding currently necessary to invoke Azure SSH.Tested the Homebrew and
az
installers locally by setting myPATH
to not include/opt/homebrew
(which coversaz
as well) and then running./p0 ssh --provider azure test
. Answering "no" to the "Do you want P0 to install these for you?" prompt correctly prints the required commands. I also replaced the Homebrew install script with a dummy script to test that the invocation works correctly when answering "yes" to the same prompt.With
az
installed, you are prompted to log in to Azure, as expected, when invoking the same command.Invoking with
PATH
hack to simulate missingbrew
/az
, without automated install:Invoking with
PATH
hack, accepting automated install, but replacing the normal Homebrew install script with my testing script:Note that the failure to invoke
brew
to installaz
is expected, since I replaced the Homebrew install script with one that doesn't install Homebrew.