# HG changeset patch # User Chris Cannam # Date 1549539512 0 # Node ID 3a8658f7e0b7c80bf4d408ec84b54fa589af2529 # Parent 622ddc1ace506a6b9619ba37196046d0fe6bed6c Add script to run build in Docker diff -r 622ddc1ace50 -r 3a8658f7e0b7 SCRIPTS/Dockerfile_ubuntu1604.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SCRIPTS/Dockerfile_ubuntu1604.in Thu Feb 07 11:38:32 2019 +0000 @@ -0,0 +1,21 @@ +FROM ubuntu:16.04 +MAINTAINER Chris Cannam +RUN apt-get update && \ + apt-get install -y \ + build-essential \ + libsndfile-dev \ + git mercurial subversion \ + curl wget zip \ + mlton \ + python libpython2.7-dev python-numpy \ + time valgrind +RUN apt-get clean && rm -rf /var/lib/apt/lists/* +RUN hg clone -r[[REVISION]] https://code.soundsoftware.ac.uk/hg/vamp-build-and-test +WORKDIR vamp-build-and-test +RUN ./SCRIPTS/update.sh [[REPO]] [[REPOREVISION]] +RUN ./SCRIPTS/update.sh vamp-plugin-sdk +RUN ./SCRIPTS/update.sh vamp-plugin-tester +RUN ( cd vamp-plugin-tester && ./repoint update ) +RUN ./SCRIPTS/process.sh native -c [[REPO]] + + diff -r 622ddc1ace50 -r 3a8658f7e0b7 SCRIPTS/dockerbuild.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SCRIPTS/dockerbuild.sh Thu Feb 07 11:38:32 2019 +0000 @@ -0,0 +1,49 @@ +#!/bin/bash +# +# Docker required! + +if [ -z "$1" ] || [ -z "$2" ]; then + echo "Usage: $0 " + exit 2 +fi + +platform=ubuntu1604 +dockerfile=SCRIPTS/Dockerfile_$platform + +mkdir -p "PACKAGES/$platform" + +if [ ! -f "$dockerfile.in" ]; then + echo "Docker file source $dockerfile.in not found (are we in the right directory?" + exit 1 +fi + +set -eu + +repo="$1" +repo_revision="$2" + +current=$(hg id | awk '{ print $1; }') + +case "$current" in + *+) echo "WARNING: Current working copy has been modified - build will check out the last commit, which must perforce be different";; + *);; +esac + +current=${current%%+} + +cat "$dockerfile.in" \ + | perl -p -e 's/\[\[REVISION\]\]/'"$current"'/' \ + | perl -p -e 's/\[\[REPO\]\]/'"$repo"'/' \ + | perl -p -e 's/\[\[REPOREVISION\]\]/'"$repo_revision"'/' \ + > "$dockerfile" + +dockertag="cannam/vamp-build-and-test-$current" + +sudo docker build -t "$dockertag" -f "$dockerfile" SCRIPTS + +container=$(sudo docker create "$dockertag") +sudo docker cp "$container":vamp-build-and-test/PACKAGES/linux64/ "PACKAGES/$platform"/ +sudo docker rm "$container" + +echo "Done!" +