entrypoint.sh 708 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/bash -x
  2. python3 -m venv /app/venv
  3. if [[ -n "$REPOSITORY_URL" ]]
  4. then
  5. echo "[global]" > /app/venv/pip.conf
  6. echo "index = $REPOSITORY_URL/" >> /app/venv/pip.conf
  7. echo "index-url = $REPOSITORY_URL/simple" >> /app/venv/pip.conf
  8. echo "trusted-host = $REPOSITORY_HOST" >> /app/venv/pip.conf
  9. fi
  10. cd /app
  11. source /app/venv/bin/activate
  12. python -m pip install --upgrade pip
  13. pip install wheel
  14. if [[ -n "$REQUIREMENTS_PACKAGES" ]]
  15. then
  16. pip install $REQUIREMENTS_PACKAGES
  17. fi
  18. if [[ -n "$PACKAGE_VERSION" ]]
  19. then
  20. pip install $PACKAGE_NAME==$PACKAGE_VERSION
  21. else
  22. pip install $PACKAGE_NAME
  23. fi
  24. if [[ -n "$STARTUP_COMMAND" ]]
  25. then
  26. $STARTUP_COMMAND
  27. else
  28. ${PACKAGE_NAME//-/_}
  29. fi