-
Notifications
You must be signed in to change notification settings - Fork 0
/
systemds_env_collect.sh
61 lines (49 loc) · 1.01 KB
/
systemds_env_collect.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
set -u
abort() {
echo $@
exit 1
}
echo "Collecting system info..."
OUTPUT_FILE=systemds_env.txt
python_bin_path=$(which python || which python3 || abort "couldn't find Python binary")
{
echo
echo '==== check python ===='
} >> ${OUTPUT_FILE}
cat <<EOF > /tmp/check_python.py
import platform
print("""python version: %s
python branch: %s
python build version: %s
python compiler version: %s
python implementation: %s
""" %(
platform.python_version(),
platform.python_branch(),
platform.python_build(),
platform.python_compiler(),
platform.python_implementation(),
))
EOF
${python_bin_path} /tmp/check_python.py 2>&1 >> ${OUTPUT_FILE}
{
echo
echo '==== check os platform =='
} >> ${OUTPUT_FILE}
cat <<DOF > /tmp/check_os.py
import platform
print("""os: %s
os kernel version: %s
os release version: %s
""" % (
platform.system(),
platform.version(),
))
EOF
${python_bin_path} /tmp/check_os.py 2>&1 >> ${OUTPUT_FILE}
{
echo '=== c++ compiler ==='
c++ --version 2>&1
echo
echo '=== maven version ==='
} >> ${OUTPUT_FILE}