comparison deploy/linux/build-and-test-appimage.sh @ 2008:55d9bbf1fe45 zoom

Merge from default branch
author Chris Cannam
date Mon, 17 Sep 2018 14:05:41 +0100
parents d7593016cad3
children f69819b5c248
comparison
equal deleted inserted replaced
2007:246bdf94ef7b 2008:55d9bbf1fe45
1 #!/bin/bash
2 #
3 # Docker required
4
5 set -eu
6
7 current=$(hg id | awk '{ print $1; }')
8
9 case "$current" in
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;;
11 *);;
12 esac
13
14 echo
15 echo "Building appimage from revision $current..."
16
17 dockerdir=deploy/linux/docker
18
19 cat "$dockerdir"/Dockerfile_appimage.in | \
20 perl -p -e "s/\[\[REVISION\]\]/$current/g" > \
21 "$dockerdir"/Dockerfile_appimage.gen
22
23 cat "$dockerdir"/Dockerfile_test_appimage.in | \
24 perl -p -e "s/\[\[REVISION\]\]/$current/g" > \
25 "$dockerdir"/Dockerfile_test_appimage.gen
26
27 dockertag="cannam/sonic-visualiser-appimage-$current"
28
29 sudo docker build -t "$dockertag" -f "$dockerdir"/Dockerfile_appimage.gen "$dockerdir"
30
31 outdir="$dockerdir/output"
32 mkdir -p "$outdir"
33
34 container=$(sudo docker create "$dockertag")
35
36 sudo docker cp "$container":output.tar "$outdir"
37 sudo docker rm "$container"
38
39 ( cd "$outdir" ; tar xf output.tar && rm -f output.tar )
40
41 sudo docker build -f "$dockerdir"/Dockerfile_test_appimage.gen "$dockerdir"