This repository has been archived by the owner on Jul 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathlinux_ubuntu_debian.sh
executable file
·75 lines (66 loc) · 2.98 KB
/
linux_ubuntu_debian.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
set -e
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
####################################################################################################
# This script installs the following tools in your Mac OS machine: #
# - Azure CLI #
# - Bicep #
# - Packer #
# - Partner Center CLI #
# - Pester #
# - PowerShell #
####################################################################################################
# Provide a path for the Python virtual environment
venvPath="${1}"
# Install Azure CLI
echo "Installing Azure CLI..."
curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
# Install Bicep
echo "Installing Bicep..."
az bicep install
# Install Packer
echo "Installing Packer..."
curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
sudo apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
sudo apt-get update && sudo apt-get install packer
# Install PowerShell
if pwsh -Version; then
echo "PowerShell is already installed."
else
# Install PowerShell
echo "Installing PowerShell..."
# Download package
curl -L https://github.com/PowerShell/PowerShell/releases/download/v7.2.4/powershell-lts_7.2.4-1.deb_amd64.deb -o powershell-lts_7.2.4-1.deb_amd64.deb
# Install the downloaded package
sudo dpkg -i powershell-lts_7.2.4-1.deb_amd64.deb
# Resolve missing dependencies and finish the install (if necessary)
sudo apt-get install -f
fi
# Install Pester
echo "Installing Pester..."
pwsh -Command "Install-Module -Name Pester -Force -SkipPublisherCheck"
pwsh -Command "Import-Module Pester -Passthru"
# Install Partner Center CLI
if [[ "$(python3 --version)" =~ "Python 3" ]]; then
echo "Installing Partner Center CLI..."
if [[ -z $venvPath ]]; then
pip install --upgrade pip
pip install pyOpenSSL --upgrade
pip install az-partner-center-cli
else
echo "Creating new virtual environment at $venvPath..."
sudo apt-get install python3-venv -y
python3 -m venv $venvPath
echo "Activating virtual environment at $venvPath..."
source $venvPath/bin/activate
if [[ $VIRTUAL_ENV =~ $venvPath ]]; then
echo "Installing Partner Center CLI in $venvPath..."
pip install --upgrade pip
pip install az-partner-center-cli
deactivate
fi
fi
else
echo "Please install Python 3.7 or higher to install the Partner Center CLI."
fi