File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818set -x
1919
2020appliance=" systemvmtemplate"
21+ build_date=` date +%Y-%m-%d`
22+ branch=" master"
23+ rootdir=$PWD
2124
2225# Initialize veewee and dependencies
2326bundle
2427
2528# Start building the appliance
2629veewee vbox build $appliance --nogui
2730veewee vbox halt $appliance
31+
32+ # Get appliance uuids
33+ machine_uuid=` vboxmanage showvminfo $appliance | grep UUID | head -1 | awk ' {print $2}' `
34+ hdd_uuid=` vboxmanage showvminfo $appliance | grep vhd | head -1 | awk ' {print $8}' | cut -d ' )' -f 1`
35+
36+ # Start exporting
37+ rm -fr dist
38+ mkdir dist
39+ cd dist
40+
41+ # Export for VMWare vSphere
42+ vboxmanage export $machine_uuid --output $appliance -$build_date -$branch -vmware.ova
43+
44+ # Export for HyperV
45+ vboxmanage clonehd $hdd_uuid $appliance -$build_date -$branch -hyperv.vhd --format VHD
46+ bzip2 $appliance -$build_date -$branch -hyperv.vhd
47+ rm $appliance -$build_date -$branch -hyperv.vhd
48+
49+ # Export for KVM
50+ vboxmanage clonehd $hdd_uuid raw.img --format RAW
51+ qemu-img convert -f raw -O qcow2 raw.img $appliance -$build_date -$branch -kvm.qcow2
52+ bzip2 $appliance -$build_date -$branch -kvm.qcow2
53+ rm $appliance -$build_date -$branch -kvm.qcow2
54+
55+ # Export for Xen
56+ # This will be an overwrite convert so, do it at the end
57+ vhd-util convert -s 0 -t 1 -i raw.img -o $appliance -$build_date -$branch -xen.vhd
58+ bzip2 $appliance -$build_date -$branch -hyperv.vhd
59+ rm $appliance -$build_date -$branch -hyperv.vhd
60+
61+ cd $rootdir
You can’t perform that action at this time.
0 commit comments