-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathazure_cli_setup
108 lines (80 loc) · 1.9 KB
/
azure_cli_setup
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/bin/bash
# Install Azure CLI (user-level installation)
# Constants ########
readonly WAITLONG=3
readonly WAITSMALL=1
####################
install()
{
sleep $WAITLONG
pkg install -y $1
}
# Main function
main() {
install_azure_cli
}
# Get Device 32-bit/64-bit
#device_64_bit() {
# cpu=$(uname -m)
# if [[ $cpu == *"64"* ]]; then
# return 0
# elif [[ $cpu == *"armv7"* ]]; then
# return 1
# else
# return 0
# fi
# }
# Download and Install Azure CLI
install_azure_cli() {
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python get-pip.py
install binutils
apt-get update -fq &&
\apt-get install -q openssl libffi make &&
\apt-get install -q openssh &&
\pip install --user virtualenv
PATH=$PATH:~/.local/bin
export PATH
# Add the PATH commands to .bashrc
echo 'PATH=$PATH:~/.local/bin' >> ~/.bashrc
echo 'export PATH' >> ~/.bashrc
# Reload .bashrc to apply changes immediately
source ~/.bashrc
source ~/.bashrc
virtualenv ~/.local/lib/azure-cli
cd ~/.local/lib/azure-cli
source ./bin/activate
pip install cffi
pip install azure-cli
pip freeze > requirements.txt
}
# Main App
main
# EDIT OR REMOVE THIS LATER
# it must be executed with admin privileges, i.e. with `sudo`.
# Main function
# main() {
# install_azure_cli
# }
# # Get Device 32-bit/64-bit
# device_64_bit() {
# cpu=$(uname -m)
# if [[ $cpu == *"64"* ]]; then
# return 0
# elif [[ $cpu == *"armv7"* ]]; then
# return 1
# else
# return 0
# fi
# }
# # Download and Install Azure CLI
# install_azure_cli() {
# device_64_bit
# bit64=$?
# if [ $bit64 -eq 0 ]; then
# curl -sL "https://aka.ms/InstallAzureCLIDeb" | sudo bash
# else
# curl -sL "https://aka.ms/InstallAzureCLIDeb" | sudo bash
# fi
# }
# # Main App
# main