|
1 | 1 | #!/usr/bin/env bash |
2 | 2 |
|
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". |
4 | 5 | # (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) |
5 | 8 |
|
6 | 9 | BASE=$(basename "$0") |
7 | 10 | DIR=$(realpath "$(dirname "$0")") |
|
15 | 18 | for dockerfile in "${ARGS[@]}"; do |
16 | 19 | image_name=${dockerfile#[0-9]*_} |
17 | 20 | 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"} |
20 | 31 | else |
21 | 32 | package_version_option="" |
22 | 33 | 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 \ |
24 | 35 | ${NO_CACHE+"--no-cache"} || |
25 | 36 | { STATUS=$?; echo "*** Failure while building [$image_name]"; exit $STATUS; } |
26 | 37 | done |
0 commit comments