Element to build and maintain local pypi mirror

We use the instructions from diskimage-builder's pypi element README to
create a copy for use with elements which need to build images more
rapidly.

Change-Id: I452c35f1b33a3d6c8118bf762b1a58be62cfe8ea
This commit is contained in:
Clint Byrum 2013-10-07 13:12:34 -07:00
parent 11a42147a1
commit 88835ff0d7
4 changed files with 52 additions and 0 deletions

View File

@ -0,0 +1,2 @@
Creates and hosts a local pypi mirror suitable for use with the pypi
element from diskimage-builder.

View File

@ -0,0 +1 @@
source-repositories

View File

@ -0,0 +1,48 @@
#!/bin/bash
# Copyright 2013 Hewlett-Packard Development Company, L.P.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
set -eux
install-packages libxml2-dev libxslt-dev libmysqlclient-dev libpq-dev \
libnspr4-dev pkg-config libsqlite3-dev libzmq-dev libffi-dev \
libldap2-dev libsasl2-dev python-dev python-pip build-essential
pip install /opt/stack/jeepyb
mkdir -p /opt/stack/pypi-mirror
cat <<EOF > /opt/stack/pypi-mirror/mirror.yaml
cache-root: /opt/stack/pypi-mirror/pypi/download
mirrors:
- name: openstack
projects:
- https://git.openstack.org/openstack/requirements
output: /opt/stack/pypi-mirror/pypi/mirror
EOF
mkdir -p /opt/stack/pypi-mirror/pypi/download
mkdir -p /opt/stack/pypi-mirror/pypi/mirror
if [ -d /etc/cron.hourly ] ; then
target=hourly
else
target=daily
fi
cat <<EOF > /etc/cron.$target/pypi-mirror-update
#!/bin/bash
run-mirror -b remotes/origin/master --verbose -c /opt/stack/pypi-mirror/mirror.yaml
EOF
chmod +x /etc/cron.$target/pypi-mirror-update

View File

@ -0,0 +1 @@
jeepyb git /opt/stack/jeepyb https://git.openstack.org/cgit/openstack-infra/jeepyb