ashb commented on a change in pull request #4938: [AIRFLOW-4117] Multi-staging
Image - Travis CI tests [Step 3/3]
URL: https://github.com/apache/airflow/pull/4938#discussion_r299358987
##########
File path: hooks/build
##########
@@ -143,12 +147,33 @@ echo
# Extract python version from image name we want to build in case it was passed
# Via IMAGE_NAME
-# This nice bash construct below extracts last field after '-' delimiter
-# So for example 'latest-3.6' will produce PYTHON_VERSION=3.6
-PYTHON_VERSION=$(echo "${LOCAL_IMAGE}" | rev | cut -d '-' -f1 | rev )
-export PYTHON_VERSION
+# This nice bash construct below extracts last field after '-python' delimiter
+# So for example 'airflow:master-python3.6' will produce
LONG_PYTHON_VERSION=python3.6
+LONG_PYTHON_VERSION=$(echo "${LOCAL_IMAGE}" | rev | cut -d '-' -f1 | rev )
Review comment:
The `##` in bash does this without a pipeline
https://www.tldp.org/LDP/abs/html/parameter-substitution.html
```bash
$ bash -c 'x="airflow:master-python3.6"; echo ${x##*-}'
python3.6
```
```suggestion
LONG_PYTHON_VERSION="${LOCAL_IMAGE##*-}"
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services