You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by hu...@apache.org on 2014/02/19 09:36:57 UTC

git commit: updated refs/heads/master to fefddc0

Repository: cloudstack
Updated Branches:
  refs/heads/master 808c6df6d -> fefddc062


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.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/fefddc06
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/fefddc06
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/fefddc06

Branch: refs/heads/master
Commit: fefddc062486ed0c997309b719fd4b2f89b9b62c
Parents: 808c6df6
Author: Hugo Trippaers <ht...@schubergphilis.com>
Authored: Wed Feb 19 09:36:03 2014 +0100
Committer: Hugo Trippaers <ht...@schubergphilis.com>
Committed: Wed Feb 19 09:36:03 2014 +0100

----------------------------------------------------------------------
 tools/appliance/build.sh | 41 ++++++++++++++++++++++-------------------
 1 file changed, 22 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fefddc06/tools/appliance/build.sh
----------------------------------------------------------------------
diff --git a/tools/appliance/build.sh b/tools/appliance/build.sh
index 2e8bc88..658aa8d 100644
--- a/tools/appliance/build.sh
+++ b/tools/appliance/build.sh
@@ -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/