-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
110 lines (67 loc) · 3.72 KB
/
setup.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
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
109
110
#
#
#!/bin/bash
#Traditionally update & upgrade
#Load all tools we need for further builds
apt-get update -y && apt-get upgrade -y && apt-get install nano sudo git curl wget build-essential libreadline-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev -y
#██████╗ ██╗ ██╗████████╗██╗ ██╗ ██████╗ ███╗ ██╗
#██╔══██╗╚██╗ ██╔╝╚══██╔══╝██║ ██║██╔═══██╗████╗ ██║
#██████╔╝ ╚████╔╝ ██║ ███████║██║ ██║██╔██╗ ██║
#██╔═══╝ ╚██╔╝ ██║ ██╔══██║██║ ██║██║╚██╗██║
#██║ ██║ ██║ ██║ ██║╚██████╔╝██║ ╚████║
#╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝
if ! python --version | grep -q 'Python 3.10\|Python 3.9\|Python 3.8'
then
wget -c https://www.python.org/ftp/python/3.10.0/Python-3.10.0.tar.xz
tar -Jxvf Python-3.10.0.tar.xz
cd Python-3.10.0
./configure --enable-optimizations
make altinstall
update-alternatives --install /usr/bin/python python /usr/local/bin/python3.10 1
update-alternatives --install /usr/bin/pip pip /usr/local/bin/pip3.10 1
#Finally-delete useless
cd ..
rm -r Python-3.10.0 Python-3.10.0.tar.xz
fi
#███╗ ██╗ ██████╗ ██████╗ ███████╗ ██╗███████╗
#████╗ ██║██╔═══██╗██╔══██╗██╔════╝ ██║██╔════╝
#██╔██╗ ██║██║ ██║██║ ██║█████╗ ██║███████╗
#██║╚██╗██║██║ ██║██║ ██║██╔══╝ ██ ██║╚════██║
#██║ ╚████║╚██████╔╝██████╔╝███████╗╚█████╔╝███████║
#╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚══════╝ ╚════╝ ╚══════╝
if ! node -v | grep -q "v17."
then
#Add public recursive DNS
echo "nameserver 8.8.8.8" >> /etc/resolv.conf
echo "nameserver 8.8.4.4" >> /etc/resolv.conf
apt install software-properties-common -y
curl -sL https://deb.nodesource.com/setup_17.x | bash -
apt update
# #Install npm and node
apt install -y nodejs
fi
#But we'll use advanced npm - pnpm
npm install pnpm -g
#And node-gyp to build Golang addons(Go => C => .node addons)
npm install node-gyp -g
# ██████╗ ██████╗
#██╔════╝ ██╔═══██╗
#██║ ███╗██║ ██║
#██║ ██║██║ ██║
#╚██████╔╝╚██████╔╝
# ╚═════╝ ╚═════╝
# https://go.dev/doc/install
KLY_GO_VERSION=`go version`
if ! $KLY_GO_VERSION | grep 'go1.1' -q
then
#Fetch archive
wget https://go.dev/dl/go1.18.linux-amd64.tar.gz
#Unpack
rm -rf /usr/local/go && tar -C /usr/local -xzf go1.18.linux-amd64.tar.gz
#Add vars to PATH
echo 'export GO111MODULE="auto"' >> ~/.bashrc
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc
source ~/.bashrc
#Don't need archive anymore
rm go1.18.linux-amd64.tar.gz
fi