added install_azure_devops_cli.sh
ca441665
Hari Sekhon
committed
1 changed file
install_azure_devops_cli.sh
/install/install_azure_devops_cli.sh+52
/install/install_azure_devops_cli.sh
Add comment 1 Plus  #!/usr/bin/env bash
Add comment 2 Plus  # vim:ts=4:sts=4:sw=4:et
Add comment 3 Plus  # shellcheck disable=SC2230
Add comment 4 Plus  # command -v catches aliases, not suitable
Add comment 5 Plus  #
Add comment 6 Plus  # Author: Hari Sekhon
Add comment 7 Plus  # Date: 2020-03-06 17:38:12 +0000 (Fri, 06 Mar 2020)
Add comment 8 Plus  #
Add comment 9 Plus  # https://github.com/HariSekhon/DevOps-Bash-tools
Add comment 10 Plus  #
Add comment 11 Plus  # License: see accompanying LICENSE file
Add comment 12 Plus  #
Add comment 13 Plus  # https://www.linkedin.com/in/HariSekhon
Add comment 14 Plus  #
Add comment 15 Plus  
Add comment 16 Plus  # Installs Azure CLI
Add comment 17 Plus  #
Add comment 18 Plus  # https://learn.microsoft.com/en-us/azure/devops/cli/?view=azure-devops
Add comment 19 Plus  
Add comment 20 Plus  # XXX: Note - as of May 2024 Azure DevOps CLI only supports the cloud not the on premise server
Add comment 21 Plus  
Add comment 22 Plus  set -euo pipefail
Add comment 23 Plus  [ -n "${DEBUG:-}" ] && set -x
Add comment 24 Plus  srcdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
Add comment 25 Plus  
Add comment 26 Plus  echo "Installing Azure DevOps CLI"
Add comment 27 Plus  echo
Add comment 28 Plus  
Add comment 29 Plus  "$srcdir/install_azure_cli.sh"
Add comment 30 Plus  echo
Add comment 31 Plus  
Add comment 32 Plus  echo "Installing Azure DevOps CLI Extension"
Add comment 33 Plus  az extension add --name azure-devops
Add comment 34 Plus  echo
Add comment 35 Plus  
Add comment 36 Plus  echo "Checking Azure DevOps CLI Extension is installed"
Add comment 37 Plus  az extension show --name azure-devops
Add comment 38 Plus  echo
Add comment 39 Plus  
Add comment 40 Plus  echo "Azure DevOps CLI extension installation complete"
Add comment 41 Plus  echo
Add comment 42 Plus  
Add comment 43 Plus  echo "Next step configure your default organization and project to avoid having to specify it in each command"
Add comment 44 Plus  echo
Add comment 45 Plus  echo "Example:"
Add comment 46 Plus  echo
Add comment 47 Plus  echo " az devops configure --defaults organization=https://dev.azure.com/harisekhon project=GitHub"
Add comment 48 Plus  echo
Add comment 49 Plus  echo "Show configuration:"
Add comment 50 Plus  echo
Add comment 51 Plus  echo " az devops configure -l"
Add comment 52 Plus