rebuild buildenv only if needed, move deb to runtime instead of copying it

This commit is contained in:
john30
2017-02-04 11:14:16 +01:00
parent 5726ab9707
commit 5fa8dfad23
+5 -2
View File
@@ -1,10 +1,13 @@
#!/bin/sh
set -e
(cd buildenv && docker build -t ebusd-buildenv .)
stamp=`docker inspect -f '{{.Created}}' ebusd-buildenv `
if [ -z "$stamp" ] || ( rm -f .stamp && touch -d "$stamp" .stamp && [ buildenv/Dockerfile -nt .stamp ] ) ; then
(cd buildenv && docker build -t ebusd-buildenv .)
fi
docker run --rm -it -v `pwd`/../..:/build ebusd-buildenv ./make_debian.sh
export EBUSD_VERSION=`cat ../../VERSION`
export EBUSD_ARCH=`docker version|grep -i "Arch[^:]*server"|head -n 1|sed -e 's#^.*/##'`
cp -a ../../ebusd-${EBUSD_VERSION}_${EBUSD_ARCH}.deb runtime/
mv ../../ebusd-${EBUSD_VERSION}_${EBUSD_ARCH}.deb runtime/
(cd runtime && docker build -t ebusd .)
echo "docker image created."
echo