-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy_python_src.exp
More file actions
executable file
·35 lines (27 loc) · 1.13 KB
/
Copy pathdeploy_python_src.exp
File metadata and controls
executable file
·35 lines (27 loc) · 1.13 KB
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
#!/usr/bin/expect -f
set timeout 300
set server "182.92.127.90"
set user "root"
set password "TANGlidong24ban!"
spawn ssh -o StrictHostKeyChecking=no $user@$server
expect "password:"
send "$password\r"
expect "# "
# Install build dependencies
send "dnf install -y gcc make zlib-devel bzip2-devel readline-devel sqlite-devel openssl-devel tk-devel libffi-devel xz-devel 2>/dev/null || yum install -y gcc make zlib-devel bzip2-devel readline-devel sqlite-devel openssl-devel tk-devel libffi-devel xz-devel\r"
expect -timeout 120 "# "
# Download and install Python 3.12
send "cd /tmp && curl -sO https://www.python.org/ftp/python/3.12.4/Python-3.12.4.tgz && tar xzf Python-3.12.4.tgz && cd Python-3.12.4 && ./configure --prefix=/usr/local --enable-optimizations --with-lto 2>&1 | tail -5\r"
expect -timeout 120 "# "
send "make -j$(nproc) 2>&1 | tail -5\r"
expect -timeout 180 "# "
send "make altinstall 2>&1 | tail -5\r"
expect -timeout 180 "# "
# Verify Python 3.12
send "python3.12 --version\r"
expect "# "
# Install pip for Python 3.12
send "python3.12 -m pip install --upgrade pip 2>&1 | tail -3\r"
expect -timeout 60 "# "
send "exit\r"
expect eof