Skip to content

Commit 59f69cd

Browse files
committed
3.6 : remove python3.6-dev
3.7, 3.10-1.13 : change mongo version to 8 3.8 : install versioned pip 3.9 : install distutils
1 parent 565f9e1 commit 59f69cd

File tree

1 file changed

+25
-19
lines changed

1 file changed

+25
-19
lines changed

install.sh

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -35,21 +35,25 @@ function install_python_packaging {
3535

3636
function install_python {
3737
local py=$1
38-
sudo apt-get install -y $py $py-dev
38+
sudo apt-get install -y $py
3939
local version=$(echo $py | grep -oP '(?<=python)\d+\.\d+')
4040

41-
if [ "$version" = "3.6" ] || [ "$version" = "3.7" ]; then
42-
sudo apt-get install ${py}-distutils || {
43-
curl --silent --show-error --retry 5 https://bootstrap.pypa.io/pip/$version/get-pip.py | sudo $py
44-
sudo $py -m pip install setuptools
45-
}
46-
elif [ "$version" = "3.10" ] || [ "$version" = "3.11" ] ; then
47-
sudo apt-get install ${py}-distutils
48-
curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo $py
49-
else
50-
sudo apt-get install ${py}
51-
curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo $py
52-
fi
41+
case $version in
42+
"3.6" | "3.7" | "3.8" )
43+
curl --silent --show-error --retry 5 https://bootstrap.pypa.io/pip/$version/get-pip.py | sudo $py
44+
;;
45+
*)
46+
curl --silent --show-error --retry 5 https://bootstrap.pypa.io/get-pip.py | sudo $py
47+
;;
48+
esac
49+
case $version in
50+
"3.8" )
51+
sudo apt-get install ${py}-distutils
52+
;;
53+
*)
54+
echo ""
55+
;;
56+
esac
5357
install_python_packaging $py
5458
}
5559

@@ -106,11 +110,13 @@ function update_apt_sources {
106110
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | gpg --dearmor -o /usr/share/keyrings/jenkins-archive-keyring.gpg
107111
echo "deb [signed-by=/usr/share/keyrings/jenkins-archive-keyring.gpg] https://pkg.jenkins.io/debian-stable binary/" | tee /etc/apt/sources.list.d/jenkins.list > /dev/null
108112

109-
# Add MongoDB GPG key and repository
110-
curl -fsSL https://www.mongodb.org/static/pgp/server-7.0.asc | \
111-
sudo gpg -o /usr/share/keyrings/mongodb-server-7.0.gpg \
112-
--dearmor
113-
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-7.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/7.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-7.0.list
113+
MONGODB_MAJOR="8.0"
114+
MONGODB_MINOR="8.2"
115+
curl -fsSL https://www.mongodb.org/static/pgp/server-${MONGODB_MAJOR}.asc | \
116+
gpg -o /usr/share/keyrings/mongodb-server-${MONGODB_MAJOR}.gpg \
117+
--dearmor
118+
echo "deb [ arch=amd64,arm64 signed-by=/usr/share/keyrings/mongodb-server-${MONGODB_MAJOR}.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/${MONGODB_MINOR} multiverse" | tee /etc/apt/sources.list.d/mongodb-org-${MONGODB_MINOR}.list
119+
114120

115121
apt install ca-certificates
116122
apt-get update
@@ -145,7 +151,7 @@ function install_jenkins {
145151
}
146152

147153
function install_mongodb {
148-
apt-get install -y mongodb mongodb-server
154+
apt-get install -y mongodb-org
149155
}
150156

151157
function install_apache {

0 commit comments

Comments
 (0)