bug 376046 - add support for specifying an ssh private key in the symbol upload script. r=bsmedberg
authorted.mielczarek@gmail.com
Tue, 24 Jul 2007 18:06:12 -0700
changeset 3922 120a21e26640fec9c322d98f6dad9ac6c4db4eba
parent 3921 0fe94f077aaf4758f069da5466d32890f2bca660
child 3923 f62599e462c889fcef50fe6d8c76574abfc6efb9
push idunknown
push userunknown
push dateunknown
reviewersbsmedberg
bugs376046
milestone1.9a7pre
bug 376046 - add support for specifying an ssh private key in the symbol upload script. r=bsmedberg
toolkit/crashreporter/tools/upload_symbols.sh
--- a/toolkit/crashreporter/tools/upload_symbols.sh
+++ b/toolkit/crashreporter/tools/upload_symbols.sh
@@ -32,25 +32,30 @@
 # decision by deleting the provisions above and replace them with the notice
 # and other provisions required by the GPL or the LGPL. If you do not delete
 # the provisions above, a recipient may use your version of this file under
 # the terms of any one of the MPL, the GPL or the LGPL.
 #
 # ***** END LICENSE BLOCK *****
 #
 # This script expects the following environment variables to be set:
-# AIRBAG_SYMBOL_SERVER  : host to upload symbols to
-# AIRBAG_SYMBOL_USER    : username on that host
-# AIRBAG_SYMBOL_PATH    : path on that host to put symbols in
+# SYMBOL_SERVER_HOST    : host to upload symbols to
+# SYMBOL_SERVER_USER    : username on that host
+# SYMBOL_SERVER_PATH    : path on that host to put symbols in
+#
+# And will use the following optional environment variable if set:
+# SYMBOL_SERVER_SSH_KEY : path to a ssh private key to use
 #
 set -e
 
-: ${AIRBAG_SYMBOL_SERVER?} ${AIRBAG_SYMBOL_USER?} ${AIRBAG_SYMBOL_PATH?} ${1?"You must specify a symbol archive to upload"}
+: ${SYMBOL_SERVER_HOST?} ${SYMBOL_SERVER_USER?} ${SYMBOL_SERVER_PATH?} ${1?"You must specify a symbol archive to upload"}
 archive=`basename $1`
 echo "Transferring symbols... $1"
-scp -v $1 ${AIRBAG_SYMBOL_USER}@${AIRBAG_SYMBOL_SERVER}:${AIRBAG_SYMBOL_PATH}/
+scp -v ${SYMBOL_SERVER_SSH_KEY:-i $SYMBOL_SERVER_SSH_KEY} $1 \
+  ${SYMBOL_SERVER_USER}@${SYMBOL_SERVER_HOST}:${SYMBOL_SERVER_PATH}/
 echo "Unpacking symbols on remote host..."
-ssh -2 -l ${AIRBAG_SYMBOL_USER} ${AIRBAG_SYMBOL_SERVER} \
+ssh -2 ${SYMBOL_SERVER_SSH_KEY:-i $SYMBOL_SERVER_SSH_KEY} \
+  -l ${SYMBOL_SERVER_USER} ${SYMBOL_SERVER_HOST} \
   "set -e;
-   cd ${AIRBAG_SYMBOL_PATH};
+   cd ${SYMBOL_SERVER_PATH};
    unzip $archive;
    rm -v $archive;"
 echo "Symbol transfer completed"