Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SAP HANA XS Delivery Unit Deployment Script
export HDBALM_PASSWD="$bamboo_DestXSPassword"
export https_proxy=http://proxy.wdf.sap.corp:8080
echo " "
echo " "
echo " "
preversion="$(/sap/hdbclient/hdbalm -s -y -h $bamboo_DestHostname -p $bamboo_DestHostPort -u $bamboo_DestXSUsername -c $bamboo_DestSSLCert du get $bamboo_DeliveryUnitName $bamboo_DeliveryUnitVendor)"
if [[ $preversion == "" ]]; then
echo "Initial install of the DU";
preinstallversion="0.0.0"
else
preinstallversion=$(echo $preversion | grep -Po '(?<=version:)[^r]+' | xargs)
fi
echo "Pre Install version: $preinstallversion"
IMPORT_LOG="$(/sap/hdbclient/hdbalm -s -y -j -h $bamboo_DestHostname -p $bamboo_DestHostPort -u $bamboo_DestXSUsername -c $bamboo_DestSSLCert import "$bamboo_DeliveryUnitFilename")"
postversion="$(/sap/hdbclient/hdbalm -s -y -h $bamboo_DestHostname -p $bamboo_DestHostPort -u $bamboo_DestXSUsername -c $bamboo_DestSSLCert du get $bamboo_DeliveryUnitName $bamboo_DeliveryUnitVendor)"
if [[ $postversion == "" ]]; then
echo "Unable to query installed delivery unit version"
postinstallversion="-1"
else
postinstallversion=$(echo $postversion | grep -Po '(?<=version:)[^r]+' | xargs)
fi
echo "Post Install version: $postinstallversion"
export HDBALM_PASSWD=""
LOG="${IMPORT_LOG##* }"
if grep -q "Successfully imported delivery units" $LOG && [[ $postinstallversion == $preinstallversion ]]; then
echo " "
echo " "
echo "******************************************************* Import of the DU completed, but the version has not changed *******************************************************"
echo " "
echo "Its possible you have not incremented the version numbers"
echo " "
echo "******************************************************* Log File $LOG *******************************************************"
echo " "
echo " "
if [ $LOG != "" ]; then
cat $LOG
else
echo "No log file, ensure the job is running on a machine with HDBALM"
fi
echo " "
echo " "
echo "******************************************************* //Log File *****************************************************"
echo " "
echo " "
exit 0
elif [ $postinstallversion == "-1" ]; then
echo " "
echo " "
echo "******************************************************* Import of the DU Has failed *******************************************************"
echo " "
echo "******************************************************* Log File *******************************************************"
echo " "
echo " "
if [ $LOG != "" ]; then
cat $LOG
else
echo "No log file, ensure the job is running on a machine with HDBALM"
fi
echo " "
echo " "
echo "******************************************************* //Log File *****************************************************"
echo " "
echo " "
exit 1
else
echo " "
echo " "
echo "******************************************************* Import of the DU has completed successfully *******************************************************"
echo " "
echo "Installation successful"
echo " "
echo " "
exit 0
fi
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.