annotate deploy/linux/build-and-test-appimage.sh @ 2142:39442b4df141

Added tag sv_v3.2pre2 for changeset c3c648a6e711
author Chris Cannam
date Sun, 02 Dec 2018 16:04:51 +0000
parents f69819b5c248
children 3a4202cae7fe
rev   line source
Chris@1924 1 #!/bin/bash
Chris@1924 2 #
Chris@1924 3 # Docker required
Chris@1924 4
Chris@1924 5 set -eu
Chris@1924 6
Chris@1924 7 current=$(hg id | awk '{ print $1; }')
Chris@1924 8
Chris@1924 9 case "$current" in
Chris@1924 10 *+) 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 11 *);;
Chris@1924 12 esac
Chris@1924 13
Chris@1924 14 echo
Chris@1926 15 echo "Building appimage from revision $current..."
Chris@1924 16
Chris@1924 17 dockerdir=deploy/linux/docker
Chris@1924 18
Chris@1924 19 cat "$dockerdir"/Dockerfile_appimage.in | \
Chris@1924 20 perl -p -e "s/\[\[REVISION\]\]/$current/g" > \
Chris@1924 21 "$dockerdir"/Dockerfile_appimage.gen
Chris@1924 22
Chris@1924 23 cat "$dockerdir"/Dockerfile_test_appimage.in | \
Chris@1924 24 perl -p -e "s/\[\[REVISION\]\]/$current/g" > \
Chris@1924 25 "$dockerdir"/Dockerfile_test_appimage.gen
Chris@1924 26
Chris@1925 27 dockertag="cannam/sonic-visualiser-appimage-$current"
Chris@1925 28
Chris@1925 29 sudo docker build -t "$dockertag" -f "$dockerdir"/Dockerfile_appimage.gen "$dockerdir"
Chris@1925 30
Chris@1925 31 outdir="$dockerdir/output"
Chris@1925 32 mkdir -p "$outdir"
Chris@1925 33
Chris@1925 34 container=$(sudo docker create "$dockertag")
Chris@1925 35
Chris@2116 36 sudo docker cp "$container":output-appimage.tar "$outdir"
Chris@1925 37 sudo docker rm "$container"
Chris@1925 38
Chris@2116 39 ( cd "$outdir" ; tar xf output-appimage.tar && rm -f output-appimage.tar )
Chris@1924 40
Chris@1924 41 sudo docker build -f "$dockerdir"/Dockerfile_test_appimage.gen "$dockerdir"