diff --git a/bin/ion_start_meshroom.sh b/bin/ion_start_meshroom.sh index 54de022e..c0df8951 100644 --- a/bin/ion_start_meshroom.sh +++ b/bin/ion_start_meshroom.sh @@ -1,5 +1,23 @@ #!/bin/bash +### retrieve versionĀ ### +if [ -z "$ION_CONTAINER_ROOT" ]; then + exit +fi + +#retrieve container hash from path +HASHID=`echo $ION_CONTAINER_ROOT | grep -Po '/[0-9a-f]{2}/[0-9a-f]{2}/[0-9a-f]+'` + +#retrieve file name using hash +CONFIGNAME=/mpc/ion/ci_metadata/${HASHID}/build_info*.json + +#Try to retrieve version number from build info +VERSION="" +if test -f $CONFIGNAME; then + VERSION=`cat $CONFIGNAME | jq .container_info.general.release_tag | xargs -n1 echo` +fi + +### Launch meshroom #### PATH_QML=${ION_CONTAINER_ROOT}/base/qml/QtQuick PATH_QML_TRUE=`readlink -f $PATH_QML`/../ PATH_PLUGIN=${ION_CONTAINER_ROOT}/base/imageformats/ @@ -7,5 +25,6 @@ PATH_PLUGIN_TRUE=`readlink -f $PATH_PLUGIN`/../ export QML2_IMPORT_PATH=$PATH_QML_TRUE:$QML2_IMPORT_PATH export QT_PLUGIN_PATH=$PATH_PLUGIN_TRUE:$QT_PLUGIN_PATH +export ION_MESHROOM_VERSION=$VERSION -python ${ION_CONTAINER_ROOT}/base/meshroom/meshroom/ui +python ${ION_CONTAINER_ROOT}/base/meshroom/meshroom/ui "$@" diff --git a/meshroom/__init__.py b/meshroom/__init__.py index 76c499a3..51a05ee3 100644 --- a/meshroom/__init__.py +++ b/meshroom/__init__.py @@ -34,6 +34,8 @@ if __version_status__ is VersionStatus.develop: # Allow override from env variable if "REZ_MESHROOM_VERSION" in os.environ: __version_label__ += " package=" + os.environ.get("REZ_MESHROOM_VERSION") + elif "ION_MESHROOM_VERSION" in os.environ: + __version_label__ += " container=" + os.environ.get("ION_MESHROOM_VERSION") # Internal imports after the definition of the version