mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
Dynamically detect the current branch and remove the build date from the systemvm name. This makes it easier to push them to the download location automagically.
This commit is contained in:
parent
808c6df6d7
commit
fefddc0624
@ -26,7 +26,10 @@ else
|
||||
fi
|
||||
|
||||
build_date=`date +%Y-%m-%d`
|
||||
branch="master"
|
||||
branch=`git status | grep '# On branch' | awk '{print $4}'`
|
||||
if [ -z "$branch" ] ; then
|
||||
branch=unknown
|
||||
fi
|
||||
rootdir=$PWD
|
||||
|
||||
# Initialize veewee and dependencies
|
||||
@ -69,10 +72,10 @@ if [ $? == 0 ]; then
|
||||
set -e
|
||||
vboxmanage internalcommands converttoraw -format vdi "$hdd_path" img.raw
|
||||
faketime '2010-01-01' vhd-util convert -s 0 -t 1 -i img.raw -o stagefixed.vhd
|
||||
faketime '2010-01-01' vhd-util convert -s 1 -t 2 -i stagefixed.vhd -o $appliance-$build_date-$branch-xen.vhd
|
||||
faketime '2010-01-01' vhd-util convert -s 1 -t 2 -i stagefixed.vhd -o $appliance-$branch-xen.vhd
|
||||
rm *.bak
|
||||
bzip2 $appliance-$build_date-$branch-xen.vhd
|
||||
echo "$appliance exported for Xen: dist/$appliance-$build_date-$branch-xen.vhd.bz2"
|
||||
bzip2 $appliance-$branch-xen.vhd
|
||||
echo "$appliance exported for Xen: dist/$appliance-$branch-xen.vhd.bz2"
|
||||
else
|
||||
echo "** Skipping $appliance export for Xen: faketime or vhd-util command is missing. **"
|
||||
echo "** faketime source code is available from https://github.com/wolfcw/libfaketime **"
|
||||
@ -83,27 +86,27 @@ set -e
|
||||
|
||||
# Export for KVM
|
||||
vboxmanage internalcommands converttoraw -format vdi "$hdd_path" raw.img
|
||||
qemu-img convert -f raw -c -O qcow2 raw.img $appliance-$build_date-$branch-kvm.qcow2
|
||||
qemu-img convert -f raw -c -O qcow2 raw.img $appliance-$branch-kvm.qcow2
|
||||
rm raw.img
|
||||
bzip2 $appliance-$build_date-$branch-kvm.qcow2
|
||||
echo "$appliance exported for KVM: dist/$appliance-$build_date-$branch-kvm.qcow2.bz2"
|
||||
bzip2 $appliance-$branch-kvm.qcow2
|
||||
echo "$appliance exported for KVM: dist/$appliance-$branch-kvm.qcow2.bz2"
|
||||
|
||||
# Export both ova and vmdk for VMWare
|
||||
vboxmanage clonehd $hdd_uuid $appliance-$build_date-$branch-vmware.vmdk --format VMDK
|
||||
bzip2 $appliance-$build_date-$branch-vmware.vmdk
|
||||
echo "$appliance exported for VMWare: dist/$appliance-$build_date-$branch-vmware.vmdk.bz2"
|
||||
vboxmanage export $machine_uuid --output $appliance-$build_date-$branch-vmware.ovf
|
||||
mv $appliance-$build_date-$branch-vmware.ovf $appliance-$build_date-$branch-vmware.ovf-orig
|
||||
java -cp convert Convert convert_ovf_vbox_to_esx.xslt $appliance-$build_date-$branch-vmware.ovf-orig $appliance-$build_date-$branch-vmware.ovf
|
||||
tar -cf $appliance-$build_date-$branch-vmware.ova $appliance-$build_date-$branch-vmware.ovf $appliance-$build_date-$branch-vmware-disk1.vmdk
|
||||
rm -f $appliance-$build_date-$branch-vmware.ovf $appliance-$build_date-$branch-vmware.ovf-orig $appliance-$build_date-$branch-vmware-disk1.vmdk
|
||||
echo "$appliance exported for VMWare: dist/$appliance-$build_date-$branch-vmware.ova"
|
||||
vboxmanage clonehd $hdd_uuid $appliance-$branch-vmware.vmdk --format VMDK
|
||||
bzip2 $appliance-$branch-vmware.vmdk
|
||||
echo "$appliance exported for VMWare: dist/$appliance-$branch-vmware.vmdk.bz2"
|
||||
vboxmanage export $machine_uuid --output $appliance-$branch-vmware.ovf
|
||||
mv $appliance-$branch-vmware.ovf $appliance-$branch-vmware.ovf-orig
|
||||
java -cp convert Convert convert_ovf_vbox_to_esx.xslt $appliance-$branch-vmware.ovf-orig $appliance-$branch-vmware.ovf
|
||||
tar -cf $appliance-$branch-vmware.ova $appliance-$branch-vmware.ovf $appliance-$branch-vmware-disk1.vmdk
|
||||
rm -f $appliance-$branch-vmware.ovf $appliance-$branch-vmware.ovf-orig $appliance-$branch-vmware-disk1.vmdk
|
||||
echo "$appliance exported for VMWare: dist/$appliance-$branch-vmware.ova"
|
||||
|
||||
# Export for HyperV
|
||||
vboxmanage clonehd $hdd_uuid $appliance-$build_date-$branch-hyperv.vhd --format VHD
|
||||
vboxmanage clonehd $hdd_uuid $appliance-$branch-hyperv.vhd --format VHD
|
||||
# HyperV doesn't support import a zipped image from S3, but we create a zipped version to save space on the jenkins box
|
||||
zip $appliance-$build_date-$branch-hyperv.vhd.zip $appliance-$build_date-$branch-hyperv.vhd
|
||||
echo "$appliance exported for HyperV: dist/$appliance-$build_date-$branch-hyperv.vhd"
|
||||
zip $appliance-$branch-hyperv.vhd.zip $appliance-$branch-hyperv.vhd
|
||||
echo "$appliance exported for HyperV: dist/$appliance-$branch-hyperv.vhd"
|
||||
|
||||
mv *-hyperv.vhd *-hyperv.vhd.zip *.bz2 *.ova dist/
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user