Commit 5c3f5d0c authored by Łukasz Nowak's avatar Ł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.

/reviewed-on nexedi/slapos.package!112
parent 3dd32552
......@@ -17,22 +17,29 @@ 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
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
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
# 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 \
--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
# Build first time to get download-cache and extends-cache ready
cd $BUILD_DIRECTORY
echo "$BUILD_ROOT_DIRECTORY" > $CURRENT_DIRECTORY/$SLAPOS_DIRECTORY/slapos/original_directory
# 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 +60,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 to comment