Merge "Permit using arbitrary PyPI urls."
This commit is contained in:
commit
86cd539496
@ -1,13 +1,15 @@
|
||||
Inject a PyPI mirror
|
||||
====================
|
||||
|
||||
Bind mounts a PyPI mirror from ~/.cache/image-create/pypi/mirror into the build
|
||||
environment and temporarily overwrites /root/.pip.conf and .pydistutils.cfg to
|
||||
use it.
|
||||
Use a custom PyPI mirror to build images. The default is to bind mount one from
|
||||
~/.cache/image-create/pypi/mirror into the build environment. The element
|
||||
temporarily overwrites /root/.pip.conf and .pydistutils.cfg to use it.
|
||||
|
||||
When online, the master pypi index is supplied as an extra-url, so uncached
|
||||
dependencies will still be available. When offline, only the mirror is used - a
|
||||
stale mirror will cause build failures.
|
||||
When online, the official pypi.python.org pypi index is supplied as an
|
||||
extra-url, so uncached dependencies will still be available. When offline, only
|
||||
the mirror is used - be warned that a stale mirror will cause build failures.
|
||||
|
||||
To use an arbitrary mirror set PYPI\_MIRROR\_URL=http[s]://somevalue/
|
||||
|
||||
[jeepyb](https://git.openstack.org/cgit/openstack-infra/jeepyb) can be useful in making a
|
||||
partial PyPI mirror suitable for building images. For instance:
|
||||
|
@ -2,6 +2,11 @@
|
||||
|
||||
set -eu
|
||||
|
||||
PYPI_MIRROR_URL=${PYPI_MIRROR_URL:-''}
|
||||
if [ -n "$PYPI_MIRROR_URL" ]; then
|
||||
# External mirror URL being used - no need to bind mount anything.
|
||||
exit 0
|
||||
fi
|
||||
MIRROR_SOURCE=~/.cache/image-create/pypi/mirror/
|
||||
MIRROR_TARGET=$TMP_MOUNT_PATH/tmp/pypi
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
set -eu
|
||||
|
||||
PYPIURL=file:///tmp/pypi
|
||||
PYPIURL=${PYPI_MIRROR_URL:-'file:///tmp/pypi'}
|
||||
mkdir -p ~/.pip
|
||||
|
||||
if [ -e ~/.pip/pip.conf ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user