2017-03-07 22:41:05 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2019-05-10 14:46:59 +02:00
|
|
|
DOCKER_IMAGE_NAME=armadillica/pillar_wheelbuilder
|
|
|
|
|
2017-03-09 11:01:36 +01:00
|
|
|
set -e
|
|
|
|
|
2017-03-07 22:41:05 +01:00
|
|
|
# macOS does not support readlink -f, so we use greadlink instead
|
|
|
|
if [ $(uname) == 'Darwin' ]; then
|
|
|
|
command -v greadlink 2>/dev/null 2>&1 || { echo >&2 "Install greadlink using brew."; exit 1; }
|
|
|
|
readlink='greadlink'
|
|
|
|
else
|
|
|
|
readlink='readlink'
|
|
|
|
fi
|
|
|
|
|
|
|
|
TOPDEVDIR="$($readlink -f ../../..)"
|
|
|
|
echo "Top-level development dir is $TOPDEVDIR"
|
|
|
|
|
|
|
|
WHEELHOUSE="$($readlink -f ../4_run/wheelhouse)"
|
|
|
|
if [ -z "$WHEELHOUSE" ]; then
|
|
|
|
echo "Error, ../4_run might not exist." >&2
|
|
|
|
exit 2
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Wheelhouse is $WHEELHOUSE"
|
|
|
|
mkdir -p "$WHEELHOUSE"
|
2019-05-10 14:46:59 +02:00
|
|
|
rm -f "$WHEELHOUSE"/*
|
2017-03-07 22:41:05 +01:00
|
|
|
|
2019-05-10 14:46:59 +02:00
|
|
|
docker build -t $DOCKER_IMAGE_NAME:latest .
|
2017-03-07 22:41:05 +01:00
|
|
|
|
2017-04-11 12:34:07 +02:00
|
|
|
GID=$(id -g)
|
2017-03-07 22:41:05 +01:00
|
|
|
docker run --rm -i \
|
|
|
|
-v "$WHEELHOUSE:/data/wheelhouse" \
|
|
|
|
-v "$TOPDEVDIR:/data/topdev" \
|
2019-05-10 14:46:59 +02:00
|
|
|
$DOCKER_IMAGE_NAME <<EOT
|
2017-03-07 22:41:05 +01:00
|
|
|
set -e
|
2021-03-18 18:42:10 +01:00
|
|
|
set -x
|
|
|
|
|
|
|
|
# Globally upgrade Pip, so that we can get a compatible version of the cryptography package.
|
|
|
|
# See https://github.com/pyca/cryptography/issues/5771
|
|
|
|
pip3 install --upgrade pip setuptools wheel
|
2021-01-20 11:08:23 +01:00
|
|
|
|
|
|
|
# Pin poetry to 1.0, as more recent version to not support nested filesystem package
|
|
|
|
# dependencies.
|
2021-03-18 18:42:10 +01:00
|
|
|
pip3 install wheel poetry==1.0 cryptography==2.7
|
2019-04-26 15:49:36 +02:00
|
|
|
|
2017-03-07 22:41:05 +01:00
|
|
|
# Build wheels for all dependencies.
|
|
|
|
cd /data/topdev/blender-cloud
|
2019-04-26 15:49:36 +02:00
|
|
|
|
|
|
|
poetry install --no-dev
|
|
|
|
|
|
|
|
# Apparently pip doesn't like projects without setup.py, so it think we have 'pillar-svnman' as
|
|
|
|
# requirement (because that's the name of the directory). We have to grep that out.
|
2019-05-10 14:46:59 +02:00
|
|
|
poetry run pip3 freeze | grep -v '\(pillar\)\|\(^-[ef] \)' > \$WHEELHOUSE/requirements.txt
|
2017-03-07 22:41:05 +01:00
|
|
|
|
2019-05-10 14:46:59 +02:00
|
|
|
pip3 wheel --wheel-dir=\$WHEELHOUSE -r \$WHEELHOUSE/requirements.txt
|
|
|
|
chown -R $UID:$GID \$WHEELHOUSE
|
2017-03-07 22:41:05 +01:00
|
|
|
EOT
|
|
|
|
|
|
|
|
# Remove our own projects, they shouldn't be installed as wheel (for now).
|
|
|
|
rm -f $WHEELHOUSE/{attract,flamenco,pillar,pillarsdk}*.whl
|
2019-05-10 14:46:59 +02:00
|
|
|
|
|
|
|
echo "Build of $DOCKER_IMAGE_NAME:latest is done."
|