Skip to content
Snippets Groups Projects
Commit 3fca195f authored by Michael Langguth's avatar Michael Langguth
Browse files

Bugfix to use bash-shell in install_venv_container.sh.

parent 4f86c3e0
No related branches found
No related tags found
No related merge requests found
Pipeline #81766 failed
#!/usr/bin/env bash
# #
# __authors__ = Bing Gong, Michael Langguth # __authors__ = Bing Gong, Michael Langguth
# __date__ = '2021_10_28' # __date__ = '2021_10_28'
...@@ -21,7 +22,7 @@ if [ -z "${SINGULARITY_NAME}" ]; then ...@@ -21,7 +22,7 @@ if [ -z "${SINGULARITY_NAME}" ]; then
fi fi
# check if directory to virtual environment is parsed # check if directory to virtual environment is parsed
if [[ -z "$1" ]]; then if [ -z "$1" ]; then
echo "ERROR: Provide a name to set up the virtual environment." echo "ERROR: Provide a name to set up the virtual environment."
return return
fi fi
...@@ -42,13 +43,14 @@ fi ...@@ -42,13 +43,14 @@ fi
# create basic target directory for virtual environment # create basic target directory for virtual environment
mkdir "${VENV_BASE}" mkdir "${VENV_BASE}"
# Install virtualenv in this directory # Install virtualenv in this directory
echo "Installing virtualenv under ${VENV_BASE}..."
pip install --target="${VENV_BASE}/" virtualenv pip install --target="${VENV_BASE}/" virtualenv
# Change into the directory... # Change into the directory...
cd "${VENV_BASE}" || exit cd "${VENV_BASE}" || exit
# .. to set-up virtual environment therein # .. to set-up virtual environment therein
python -m virtualenv -p /usr/bin/python --system-site-packages "${VENV_NAME}" python -m virtualenv -p /usr/bin/python --system-site-packages "${VENV_NAME}"
# Activate virtual environment and install required packages # Activate virtual environment and install required packages
echo "Actiavting virtual environment ${ENV_DIR} to install required Python modules..." echo "Actiavting virtual environment ${VENV_NAME} to install required Python modules..."
source "${VENV_DIR}/bin/activate" source "${VENV_DIR}/bin/activate"
pip install -r "${BASE_DIR}/requirements_container.txt" pip install -r "${BASE_DIR}/requirements_container.txt"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment