Commit 8bb8179a by Łukasz Nowak

obs/slapos: Create networkcached buildout

Thanks to injecting slapos.networkcache to provided buildout, it will be
possible to use networkcache for fetching the dependencies.
parent 3dd32552
......@@ -17,10 +17,20 @@ echo "Preparing source tarball (recipe version: $RECIPE_VERSION)"
echo " Build Directory: $BUILD_DIRECTORY "
echo " Buildroot Directory: $BUILD_ROOT_DIRECTORY "
mkdir -p $BUILD_DIRECTORY/{eggs,extends-cache,download-cache,download-cache/dist}
mkdir -p $BUILD_DIRECTORY/{eggs,extends-cache,download-cache,download-cache/dist,tmp-networkcached/eggs}
set -e
echo "Preparing networkcached zc.buildout"
NETWORKCACHED_DIRECTORY=$BUILD_DIRECTORY/tmp-networkcached
sed "s/\%RECIPE_VERSION\%/$RECIPE_VERSION/g;s|\%PATCHES_DIRECTORY\%|$PATCHES_DIRECTORY|g;s|\%TARGET_DIRECTORY\%|$TARGET_DIRECTORY|g;s|\%BUILD_ROOT_DIRECTORY\%|$BUILD_ROOT_DIRECTORY|g;s|\%BUILD_DIRECTORY\%|$BUILD_DIRECTORY|g" $BUILD_ROOT_DIRECTORY/../networkcached.cfg.in > $NETWORKCACHED_DIRECTORY/buildout.cfg
cd $NETWORKCACHED_DIRECTORY
wget https://bootstrap.pypa.io/bootstrap-buildout.py --no-check-certificate -O bootstrap.py
(python -S bootstrap.py --buildout-version $BUILDOUT_VERSION \
--setuptools-to-dir eggs \
-f http://www.nexedi.org/static/packages/source/slapos.buildout/ && \
./bin/buildout -v)
sed "s/\%RECIPE_VERSION\%/$RECIPE_VERSION/g;s|\%PATCHES_DIRECTORY\%|$PATCHES_DIRECTORY|g;s|\%TARGET_DIRECTORY\%|$TARGET_DIRECTORY|g;s|\%BUILD_ROOT_DIRECTORY\%|$BUILD_ROOT_DIRECTORY|g;s|\%BUILD_DIRECTORY\%|$BUILD_DIRECTORY|g" $BUILD_ROOT_DIRECTORY/../buildout.cfg.in > $BUILD_DIRECTORY/buildout.cfg
......@@ -32,7 +42,7 @@ echo "$BUILD_ROOT_DIRECTORY" > $CURRENT_DIRECTORY/$SLAPOS_DIRECTORY/slapos/origi
# Download bootstrap file
wget https://bootstrap.pypa.io/bootstrap-buildout.py --no-check-certificate -O bootstrap.py
(python -S bootstrap.py --buildout-version $BUILDOUT_VERSION \
($NETWORKCACHED_DIRECTORY/bin/buildout bootstrap --buildout-version $BUILDOUT_VERSION \
--setuptools-to-dir eggs \
-f http://www.nexedi.org/static/packages/source/slapos.buildout/ && \
./bin/buildout -v) || (./bin/buildout -v || (echo "Failed to run buildout, exiting." && exit 1))
......@@ -53,7 +63,7 @@ rm -rfv ./{downloads,parts,eggs,develop-eggs,bin,rebootstrap}
find . -type d -empty -prune -exec rmdir '{}' ';'
mkdir -p $BUILD_DIRECTORY/eggs
python -S bootstrap.py --buildout-version $BUILDOUT_VERSION \
$NETWORKCACHED_DIRECTORY/bin/buildout bootstrap --buildout-version $BUILDOUT_VERSION \
--setuptools-to-dir eggs \
-f http://www.nexedi.org/static/packages/source/ \
-f http://www.nexedi.org/static/packages/source/slapos.buildout/
......
[buildout]
rootdir = %TARGET_DIRECTORY%
destdir = %BUILD_ROOT_DIRECTORY%
builddir = %BUILD_DIRECTORY%
extends =
%BUILD_ROOT_DIRECTORY%/../slapos_repository/component/slapos/obs.cfg
extensions =
parts =
networkcached
[networkcached]
recipe = zc.recipe.egg
eggs =
slapos.libnetworkcache
zc.buildout
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment