#!/bin/bash currentdir=/home/sjm84 # On the linux VM machines that produce nightlies: # set currentdir to /home/sjm84 (after chroot on /opt/lsb) # or set currentdir to home/sjm84 if lsb is only mounted but # the chroot to /opt/lsb step has not been done yet. if ! test -f "$currentdir/expeditee-release-kits/rke-setup.sh"; then echo "" echo "********************" echo "First edit $currentdir/expeditee-release-kits/rke-setup.sh.in" echo "to generate $currentdir/expeditee-release-kits/rke-setup.sh" echo "" echo "********************" echo "" exit -1 else # rke-setup uses local paths, so cd into expeditee-release-kits first # then call rke-setup.sh to source the environment vars it sets pushd "$currentdir/expeditee-release-kits" source "rke-setup.sh" returnval=$? if [ "$returnval" != "0" ]; then echo "Error running rke-setup.sh, return value: $returnval" popd exit -2 else popd # Make sure the expeditee folder and its rke-build.properties file exist # then run the 'rke' command from snapshots\expeditee pushd "$currentdir/snapshots" if test -d expeditee; then echo "Deleting $currentdir/snapshots/expeditee...." rm -rf $currentdir/snapshots/expeditee fi if ! test -d expeditee; then mkdir expeditee fi if ! test -f expeditee/rke-build.properties; then cp $currentdir/expeditee-release-kits/rke-build.properties.in expeditee/rke-build.properties fi pushd expeditee rke # http://stackoverflow.com/questions/1401482/yyyy-mm-dd-format-date-in-shell-script DATE=`date +%Y-%m-%d` # Uploading mkdir uploads cp products/Expeditee-1-linux uploads/Expeditee-1-${DATE}-linux64 cp rke.out uploads/Expeditee-${DATE}-linux64.out cd uploads && tar -c * | ssh -T -i "/root/.ssh/upload-expeditee-l64" anupama@wharariki.cms.waikato.ac.nz exit 0 fi fi