ci-docker.sh 677 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
if test -n "$DEBIAN_PACKAGES" -o -n "$OPAM_PACKAGES"; then
  IMAGE=bench-image-$COMPILER--$(echo $DEBIAN_PACKAGES | sed -e 's/ /--/g')--$(echo $OPAM_PACKAGES | sed -e 's/ /--/g')
8 9 10
else
  IMAGE=bench-image-$COMPILER
fi
11
docker build -t $IMAGE -f misc/Dockerfile.init --build-arg compiler=$COMPILER --build-arg debian_packages="$DEBIAN_PACKAGES" --build-arg opam_packages="$OPAM_PACKAGES" .
12
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