bug 607946 - Allow specifying a post-upload command for uploadsymbols. r=catlee a=bsmedberg
authorTed Mielczarek <ted.mielczarek@gmail.com>
Mon, 01 Nov 2010 14:47:16 -0400
changeset 56844 39a979e269314d44ae462327b9e27c9739aa0a07
parent 56843 0c4fb639c49e8e102c9d2d9b106fec94d81f037c
child 56847 4bfbc7353fda5aa410194ca54d1c6f66c6de1bfa
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscatlee, bsmedberg
bugs607946
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 607946 - Allow specifying a post-upload command for uploadsymbols. r=catlee a=bsmedberg
Makefile.in
toolkit/crashreporter/tools/upload_symbols.sh
--- a/Makefile.in
+++ b/Makefile.in
@@ -166,17 +166,17 @@ endif
 SYM_STORE_SOURCE_DIRS := $(topsrcdir)
 
 include $(topsrcdir)/toolkit/mozapps/installer/package-name.mk
 
 ifdef MOZ_SYMBOLS_EXTRA_BUILDID
 EXTRA_BUILDID := -$(MOZ_SYMBOLS_EXTRA_BUILDID)
 endif
 
-SYMBOL_INDEX_NAME = \
+export SYMBOL_INDEX_NAME = \
   $(MOZ_APP_NAME)-$(MOZ_APP_VERSION)-$(OS_TARGET)-$(BUILDID)$(EXTRA_BUILDID)-symbols.txt
 
 buildsymbols:
 ifdef MOZ_CRASHREPORTER
 	echo building symbol store
 	$(RM) -rf $(DIST)/crashreporter-symbols
 	$(RM) -f "$(DIST)/$(SYMBOL_ARCHIVE_BASENAME).zip"
 	$(NSINSTALL) -D $(DIST)/crashreporter-symbols
--- a/toolkit/crashreporter/tools/upload_symbols.sh
+++ b/toolkit/crashreporter/tools/upload_symbols.sh
@@ -39,16 +39,19 @@
 # This script expects the following environment variables to be set:
 # 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 variables if set:
 # SYMBOL_SERVER_SSH_KEY : path to a ssh private key to use
 # SYMBOL_SERVER_PORT    : port to use for ssh
+# POST_SYMBOL_UPLOAD_CMD: a commandline to run on the remote host after
+#                         uploading. The full path of the symbol index
+#                         file will be appended to the commandline.
 #
 set -e
 
 : ${SYMBOL_SERVER_HOST?} ${SYMBOL_SERVER_USER?} ${SYMBOL_SERVER_PATH?} ${1?"You must specify a symbol archive to upload"}
 hash=`openssl dgst -sha1 "$1" | sed 's/^.*)=//' | sed 's/\ //g'`
 archive="${hash}-"`basename "$1" | sed 's/\ //g'`
 echo "Transferring symbols... $1"
 scp ${SYMBOL_SERVER_PORT:+-P $SYMBOL_SERVER_PORT} \
@@ -58,9 +61,16 @@ echo "Unpacking symbols on remote host..
 ssh -2 ${SYMBOL_SERVER_PORT:+-p $SYMBOL_SERVER_PORT} \
   ${SYMBOL_SERVER_SSH_KEY:+-i "$SYMBOL_SERVER_SSH_KEY"} \
   -l ${SYMBOL_SERVER_USER} ${SYMBOL_SERVER_HOST} \
   "set -e;
    umask 0022;
    cd ${SYMBOL_SERVER_PATH};
    unzip -o '$archive';
    rm -v '$archive';"
+if test -n "$POST_SYMBOL_UPLOAD_CMD"; then
+  echo "${POST_SYMBOL_UPLOAD_CMD} \"${SYMBOL_SERVER_PATH}/${SYMBOL_INDEX_NAME}\""
+  ssh -2 ${SYMBOL_SERVER_PORT:+-p $SYMBOL_SERVER_PORT} \
+  ${SYMBOL_SERVER_SSH_KEY:+-i "$SYMBOL_SERVER_SSH_KEY"} \
+  -l ${SYMBOL_SERVER_USER} ${SYMBOL_SERVER_HOST} \
+  "${POST_SYMBOL_UPLOAD_CMD} \"${SYMBOL_SERVER_PATH}/${SYMBOL_INDEX_NAME}\""
+fi
 echo "Symbol transfer completed"