Skip to content

Commit

Permalink
Allow installation of extra system dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafael Almeida committed Feb 28, 2023
1 parent 7674fb2 commit 6431a63
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,27 @@ if [ ! -f requirements.txt ] && [ ! -f pyproject.toml ]; then
exit 0;
fi

# Check if EXTRA_SYSTEM_DEPENDENCIES is set
if [ -n "$EXTRA_SYSTEM_DEPENDENCIES" ]; then
printf "\n\nInstalling extra system dependencies: '%s'" "$EXTRA_SYSTEM_DEPENDENCIES"
apt-get update &> ~/cmd.log
# shellcheck disable=SC2086
apt-get install -y gcc $EXTRA_SYSTEM_DEPENDENCIES &> ~/cmd.log
printf "\n\nExtra system dependencies installed successfully!"
fi

python -m pip install --upgrade pip &> ~/cmd.log

if [ -f pyproject.toml ]; then
pip install poetry &> ~/cmd.log
poetry source add --secondary artifactory https://deeperinsights.jfrog.io/artifactory/api/pypi/deeper-insights-pypi/simple
poetry config http-basic.artifactory $EXTRA_INDEX_URL_USERNAME $EXTRA_INDEX_URL_PASSWORD
poetry config http-basic.artifactory "$EXTRA_INDEX_URL_USERNAME" "$EXTRA_INDEX_URL_PASSWORD"
poetry export -f requirements.txt --output requirements.txt --without-hashes &> ~/cmd.log
fi

python -m venv env

# shellcheck source=/dev/null
# shellcheck disable=SC1091
. env/bin/activate

# Update pip inside the virtual environment
Expand Down

0 comments on commit 6431a63

Please sign in to comment.