Skip to content

Commit b5c11a1

Browse files
committed
version-string-driven building of python interpreter builder image
1 parent 62cf4dd commit b5c11a1

File tree

2 files changed

+17
-6
lines changed

2 files changed

+17
-6
lines changed

irods/test/harness/003_compile-specific-python.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from ssl-and-pam
22
run apt update
3-
run apt install -y wget build-essential libssl-dev zlib1g-dev
4-
run apt install wget build-essential
3+
run apt install -y wget build-essential
4+
run apt install -y libssl-dev zlib1g-dev libffi-dev libncurses-dev wget build-essential
55
arg python_version
66
run wget https://www.python.org/ftp/python/${python_version}/Python-${python_version}.tar.xz
77
run tar xf Python-${python_version}.tar.xz

irods/test/harness/build-docker.sh

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#!/usr/bin/env bash
22

3-
# IRODS_PACKAGE_VERSION if defined is like "4.3.1-0~bionic"
3+
# environment variables for build
4+
# IRODS_PACKAGE_VERSION if defined is like "4.3.4" or "5.0.1".
45
# (but contains no '~' suffix for irods versions <= 4.2.10)
6+
# PYTHON_VERSION is usually two dot-separated numbers: example "3.13", but could also have zero, one or three version numbers.
7+
# (Do not specify the triple form, X.Y.Z, if that release is not known to exist - not counting alphas and release candidates)
58

69
BASE=$(basename "$0")
710
DIR=$(realpath "$(dirname "$0")")
@@ -15,12 +18,20 @@ fi
1518
for dockerfile in "${ARGS[@]}"; do
1619
image_name=${dockerfile#[0-9]*_}
1720
image_name=${image_name%.Dockerfile}
18-
if [ "$image_name" = "install-irods" ];then
19-
package_version_option=${IRODS_PACKAGE_VERSION:+"--build-arg=irods_package_version=$IRODS_PACKAGE_VERSION"}
21+
irods_package_version_option=""
22+
python_version_option=""
23+
if [ "$image_name" = "install-irods" ]; then
24+
irods_package_version_option=${IRODS_PACKAGE_VERSION:+"--build-arg=irods_package_version=$IRODS_PACKAGE_VERSION"}
25+
elif [ "$image_name" = "compile-specific-python" ]; then
26+
temp=$(./most_recent_python.sh $PYTHON_VERSION)
27+
if [ -n "$temp" ]; then
28+
PYTHON_VERSION="$temp"
29+
fi
30+
python_version_option=${PYTHON_VERSION:+"--build-arg=python_version=$PYTHON_VERSION"}
2031
else
2132
package_version_option=""
2233
fi
23-
$DOCKER build -f $dockerfile -t $image_name . $package_version_option \
34+
$DOCKER build -f $dockerfile -t $image_name . $irods_package_version_option $python_version_option \
2435
${NO_CACHE+"--no-cache"} ||
2536
{ STATUS=$?; echo "*** Failure while building [$image_name]"; exit $STATUS; }
2637
done

0 commit comments

Comments
 (0)