2010-09-19 09:44:28 -07:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Note:
|
|
|
|
# This script is meant to be run from the root of the working copy.
|
|
|
|
#
|
|
|
|
# This script sets the name of the .dmg and dSYM bundle as it uploads them and does some link magic.
|
|
|
|
|
|
|
|
# Config
|
2011-01-21 23:17:08 -08:00
|
|
|
rtag="$(git branch --no-color | sed -e '/^[^*]/d' -e 's:* \(.*\):\1:')"
|
2011-03-22 22:45:58 -07:00
|
|
|
uurl="buildbot@buildbot.wz2100.net"
|
2010-09-19 21:31:37 -07:00
|
|
|
opth="${rtag}/mac/"
|
2010-09-19 09:44:28 -07:00
|
|
|
rpth="public_html/"
|
|
|
|
lpth="macosx/build/dmgout/out/"
|
2010-10-27 11:26:57 -07:00
|
|
|
revt="-$(git rev-parse -q --short --verify HEAD)"
|
2010-09-19 09:44:28 -07:00
|
|
|
dmg_bn="warzone2100"
|
|
|
|
dmg_nv="-novideo.dmg"
|
|
|
|
tar_dS="-dSYM.tar.gz"
|
|
|
|
|
|
|
|
|
|
|
|
# Set bran
|
2011-01-21 23:17:08 -08:00
|
|
|
if [ -z ${rtag} ]; then
|
2010-09-19 09:44:28 -07:00
|
|
|
echo "Must supply the branch name being built."
|
|
|
|
exit 1
|
|
|
|
fi
|
2010-09-19 21:31:37 -07:00
|
|
|
bran="-${rtag}"
|
2010-09-19 09:44:28 -07:00
|
|
|
|
|
|
|
|
|
|
|
# Upload the dSYM bundle
|
2011-03-22 21:42:37 -07:00
|
|
|
echo "Starting to upload the dSYM bundle."
|
|
|
|
if ! scp -pqCl 320 ${lpth}${dmg_bn}${tar_dS} ${uurl}:${rpth}${opth}${dmg_bn}${bran}${revt}${tar_dS}; then
|
2011-03-24 16:32:42 -07:00
|
|
|
exstat="${?}"
|
2011-03-22 21:42:37 -07:00
|
|
|
echo "error: Upload did not complete!"
|
2011-03-24 16:32:42 -07:00
|
|
|
exit ${exstat}
|
2010-09-19 09:44:28 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Upload the .dmg
|
2011-03-22 21:42:37 -07:00
|
|
|
echo "Starting to upload the dmg image."
|
|
|
|
if ! scp -pqCl 320 ${lpth}${dmg_bn}${dmg_nv} ${uurl}:${rpth}${opth}${dmg_bn}${bran}${revt}.dmg; then
|
2011-03-24 16:32:42 -07:00
|
|
|
exstat="${?}"
|
2011-03-22 21:42:37 -07:00
|
|
|
echo "error: Upload did not complete!"
|
2011-03-24 16:32:42 -07:00
|
|
|
exit ${exstat}
|
2010-09-19 09:44:28 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
# Link up the current .dmg and dSYM bundle
|
2011-01-21 23:17:08 -08:00
|
|
|
if ! ssh ${uurl} -C "cd ${rpth} && ln -fs ${opth}${dmg_bn}${bran}${revt}.dmg ${dmg_bn}${bran}-current.dmg && ln -fs ${opth}${dmg_bn}${bran}${revt}${tar_dS} ${dmg_bn}${bran}-current${tar_dS}"; then
|
2011-03-24 16:32:42 -07:00
|
|
|
exstat="${?}"
|
2011-03-22 21:42:37 -07:00
|
|
|
echo "error: Failed to link!"
|
2011-03-24 16:32:42 -07:00
|
|
|
exit ${exstat}
|
2011-01-21 23:17:08 -08:00
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|