ci-docker.sh 539 Bytes
Newer Older
Guillaume Melquiond's avatar
Guillaume Melquiond committed
1 2
#!/bin/bash

3
set -e
Guillaume Melquiond's avatar
Guillaume Melquiond committed
4 5

autoconf && (automake --add-missing 2> /dev/null || true)
6 7 8 9 10 11 12
if test -n "$PACKAGES"; then
  IMAGE=bench-image-$COMPILER--$(echo $PACKAGES | sed -e 's/ /--/g')
else
  IMAGE=bench-image-$COMPILER
fi
docker build -t $IMAGE -f misc/Dockerfile.init --build-arg compiler=$COMPILER --build-arg packages="$PACKAGES" .
CID=$(docker create --rm -i -w /home/why3/why3 $IMAGE /bin/sh)
Guillaume Melquiond's avatar
Guillaume Melquiond committed
13 14 15 16 17 18
docker start $CID
docker cp . $CID:/home/why3/why3
docker exec -u root $CID chown -R why3:why3 /home/why3/why3
docker attach $CID <<EOF
exec $@
EOF