Chris@1924: #!/bin/bash Chris@1924: # Chris@1924: # Docker required Chris@1924: Chris@1924: set -eu Chris@1924: Chris@1924: current=$(hg id | awk '{ print $1; }') Chris@1924: Chris@1924: case "$current" in Chris@1924: *+) echo "ERROR: Current working copy has been modified - unmodified copy required so we know we can check it out separately and obtain the same contents"; exit 2;; Chris@1924: *);; Chris@1924: esac Chris@1924: Chris@1924: echo Chris@1926: echo "Building appimage from revision $current..." Chris@1924: Chris@1924: dockerdir=deploy/linux/docker Chris@1924: Chris@1924: cat "$dockerdir"/Dockerfile_appimage.in | \ Chris@1924: perl -p -e "s/\[\[REVISION\]\]/$current/g" > \ Chris@1924: "$dockerdir"/Dockerfile_appimage.gen Chris@1924: Chris@1924: cat "$dockerdir"/Dockerfile_test_appimage.in | \ Chris@1924: perl -p -e "s/\[\[REVISION\]\]/$current/g" > \ Chris@1924: "$dockerdir"/Dockerfile_test_appimage.gen Chris@1924: Chris@1925: dockertag="cannam/sonic-visualiser-appimage-$current" Chris@1925: Chris@1925: sudo docker build -t "$dockertag" -f "$dockerdir"/Dockerfile_appimage.gen "$dockerdir" Chris@1925: Chris@1925: outdir="$dockerdir/output" Chris@1925: mkdir -p "$outdir" Chris@1925: Chris@1925: container=$(sudo docker create "$dockertag") Chris@1925: Chris@1925: sudo docker cp "$container":output.tar "$outdir" Chris@1925: sudo docker rm "$container" Chris@1925: Chris@1925: ( cd "$outdir" ; tar xf output.tar && rm -f output.tar ) Chris@1924: Chris@1924: sudo docker build -f "$dockerdir"/Dockerfile_test_appimage.gen "$dockerdir"