Path: blob/master/web-gui/docker-pyinstaller/entrypoint-windows.sh
1292 views
#!/bin/bash12# Fail on errors.3set -e45# Make sure .bashrc is sourced6. /root/.bashrc78# Allow the workdir to be set using an env var.9# Useful for CI pipiles which use docker for their build steps10# and don't allow that much flexibility to mount volumes11WORKDIR=${SRCDIR:-/src}1213#14# In case the user specified a custom URL for PYPI, then use15# that one, instead of the default one.16#17if [[ "$PYPI_URL" != "https://pypi.python.org/" ]] || \18[[ "$PYPI_INDEX_URL" != "https://pypi.python.org/simple" ]]; then19# the funky looking regexp just extracts the hostname, excluding port20# to be used as a trusted-host.21mkdir -p /wine/drive_c/users/root/pip22echo "[global]" > /wine/drive_c/users/root/pip/pip.ini23echo "index = $PYPI_URL" >> /wine/drive_c/users/root/pip/pip.ini24echo "index-url = $PYPI_INDEX_URL" >> /wine/drive_c/users/root/pip/pip.ini25echo "trusted-host = $(echo $PYPI_URL | perl -pe 's|^.*?://(.*?)(:.*?)?/.*$|$1|')" >> /wine/drive_c/users/root/pip/pip.ini2627echo "Using custom pip.ini: "28cat /wine/drive_c/users/root/pip/pip.ini29fi3031cd $WORKDIR3233if [ -f requirements.txt ]; then34pip install -r requirements.txt35fi # [ -f requirements.txt ]3637echo "$@"3839if [[ "$@" == "" ]]; then40pyinstaller --clean -y --dist ./dist/windows --workpath /tmp *.spec41chown -R --reference=. ./dist/windows42else43sh -c "$@"44fi # [[ "$@" == "" ]]45464748