use CP_CAP_MODULE_PREINSTALLED flag to check that modules were installed
@@ -35,11 +35,16 @@ IS_RPM_BASED=$?
######################################################
CP_CAP_MODULES_TYPE="${CP_CAP_MODULES_TYPE:-tcl}"
+if [ "$CP_CAP_MODULE_PREINSTALLED" != "true" ]; then
pipe_log_info "--> Installing Environment Modules: $CP_CAP_MODULES_TYPE" "$MODULES_INSTALL_TASK"
+else
+ pipe_log_info "--> Configuring Environment Modules: $CP_CAP_MODULES_TYPE" "$MODULES_INSTALL_TASK"
+fi
mkdir -p /tmp/modules-tmp
cd /tmp/modules-tmp
+if [ "$CP_CAP_MODULE_PREINSTALLED" != "true" ]; then
# Grab the sources of modules
if [ "$CP_CAP_MODULES_TYPE" == "tcl" ]; then
MODULES_SOURCES_URL_S3="https://cloud-pipeline-oss-builds.s3.amazonaws.com/tools/modules/sources/modules-4.2.4.tar.gz"
@@ -64,9 +69,11 @@ if [ $? -ne 0 ]; then
fi
tar -zxf modules.tar.gz
+fi
_MODULES_INSTALL_RESULT=1
if [ "$CP_CAP_MODULES_TYPE" == "tcl" ]; then
+ if [ "$CP_CAP_MODULE_PREINSTALLED" != "true" ]; then
if [[ "$IS_RPM_BASED" = 0 ]]; then
yum -y -q install tcl-devel less
_MODULES_INSTALL_RESULT=$?
@@ -96,6 +103,7 @@ if [ "$CP_CAP_MODULES_TYPE" == "tcl" ]; then
pipe_log_fail "Unable to install modules from sources, exiting. Build logs are available in $MODULES_BUILD_LOG" "$MODULES_INSTALL_TASK"
exit 1
fi
+ fi
# Configure the modules setup
if [ -f $MODULES_INSTALL_DIR/init/profile.sh ]; then
@@ -104,6 +112,7 @@ if [ "$CP_CAP_MODULES_TYPE" == "tcl" ]; then
ln -s $MODULES_INSTALL_DIR/init/profile.sh /etc/profile.d/modules.sh
elif [ "$CP_CAP_MODULES_TYPE" == "lmod" ]; then
+ if [ "$CP_CAP_MODULE_PREINSTALLED" != "true" ]; then
if [[ "$IS_RPM_BASED" = 0 ]]; then
yum install -y -q lua lua-bitop lua-devel lua-filesystem \
lua-json lua-lpeg lua-posix lua-term tcl4 tcl-devel less gcc
@@ -139,6 +148,7 @@ elif [ "$CP_CAP_MODULES_TYPE" == "lmod" ]; then
pipe_log_fail "Unable to install lmod from sources, exiting. Build logs are available in $MODULES_BUILD_LOG" "$MODULES_INSTALL_TASK"
exit 1
fi
+ fi
# Configure the modules setup
if [ -f $MODULES_INSTALL_DIR/lmod/lmod/init/profile ]; then
