summaryrefslogtreecommitdiff
path: root/vmbuild
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-10-01 21:12:09 +0100
committerCarl Hetherington <cth@carlh.net>2015-10-01 21:12:09 +0100
commit7315bffa601f357f0998e4446289faf74cc1ee08 (patch)
tree9fb6534a59f472e1bf3c2a38c46872eaca51855f /vmbuild
parent05e8f8ae9bc9764e9d1510ae4d3a0d87e9b28e12 (diff)
Add vmbuild script, for want of anywhere else to keep it.
Diffstat (limited to 'vmbuild')
-rwxr-xr-xvmbuild28
1 files changed, 28 insertions, 0 deletions
diff --git a/vmbuild b/vmbuild
new file mode 100755
index 0000000..f8dc117
--- /dev/null
+++ b/vmbuild
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+if [ "$1" == "" ]; then
+ echo "Syntax: $0 <target> [<checkout>]"
+fi
+
+IFS='-' read distro version bits <<< $1
+
+if [ "$2" != "" ]; then
+ checkout="-c $2"
+fi
+
+if [ "$bits" == "32" ]; then
+ port=2000
+elif [ "$bits" == "64" ]; then
+ port=2001
+else
+ echo "Unrecognised bit depth $bits"
+ exit 1
+fi
+
+nohup vboxheadless --startvm fedora-22-$bits &
+sleep 10
+ssh -p $port carl@localhost "rm -rf fedora-*"
+ssh -p $port carl@localhost cdist -p dcpomatic -c $checkout -t host package
+scp -P $port carl@localhost:fedora-22-$bits/* .
+ssh -p $port carl@localhost "sudo /sbin/poweroff"
+