##// END OF EJS Templates
hghave: add a check for docker support...
hghave: add a check for docker support This currently refuses to operate if on a non-Linux host. I suspect that Docker running on FreeBSD 11 or on an Illumos derivative would work fine, but I don't have ready access to such a system. On OS X using boot2docker (I used a hacky xhyve-based one for testing), it won't work because $TESTTEMP doesn't end up inside the set of directories that get forwarded to the boot2docker VM, so you can't actually drop debs in the $TESTTEMP at all. It would be possible (probably even trivial) to hack around this by using a randomly-named temporary directory inside the working directory, but that seems unlikely to be useful enough to justify the ugliness.

File last commit:

r26108:05306b93 default
r26111:dcc12365 default
Show More
dockerdeb
40 lines | 1.2 KiB | text/plain | TextLexer
#!/bin/bash -eu
. $(dirname $0)/dockerlib.sh
. $(dirname $0)/packagelib.sh
BUILDDIR=$(dirname $0)
export ROOTDIR=$(cd $BUILDDIR/..; pwd)
checkdocker
DEBPLATFORM="$1"
PLATFORM="debian-$1"
shift # extra params are passed to build process
initcontainer $PLATFORM
DEBBUILDDIR=${OUTPUTDIR:=$ROOTDIR/packages/$PLATFORM}
OUTPUTDIR=$DEBBUILDDIR/staged contrib/builddeb --release $DEBPLATFORM --prepare
DSHARED=/mnt/shared/
if [ $(uname) = "Darwin" ] ; then
$DOCKER run -u $DBUILDUSER --rm -v $DEBBUILDDIR:$DSHARED -v $PWD:/mnt/hg $CONTAINER \
sh -c "cd /mnt/hg && make clean && make local"
fi
$DOCKER run -u $DBUILDUSER --rm -v $DEBBUILDDIR:$DSHARED -v $PWD:/mnt/hg $CONTAINER \
sh -c "cd /mnt/hg && make PREFIX=$DSHARED/staged/usr install"
$DOCKER run -u $DBUILDUSER --rm -v $DEBBUILDDIR:$DSHARED $CONTAINER \
dpkg-deb --build $DSHARED/staged
if [ $(uname) = "Darwin" ] ; then
$DOCKER run -u $DBUILDUSER --rm -v $DEBBUILDDIR:$DSHARED -v $PWD:/mnt/hg $CONTAINER \
sh -c "cd /mnt/hg && make clean"
fi
gethgversion
rm -r $DEBBUILDDIR/staged
mv $DEBBUILDDIR/staged.deb $DEBBUILDDIR/mercurial-$version-$release.deb
echo
echo "Build complete - results can be found in $DEBBUILDDIR"