Bug 1172107 - Add the ability to upload dist files after a successful build; r=ahal
authorMorgan Phillips <winter2718@gmail.com>
Wed, 10 Jun 2015 22:35:46 +0200
changeset 248153 15ff3cdc68bd73c3a13e8a1baea70d71c671bad0
parent 248152 0a716b0dee4466f26df0b419889baea8f708b0c6
child 248154 3dc2e5481e1a5c9c4cfa89b58f79eff9fd90cd10
push id28893
push userkwierso@gmail.com
push dateFri, 12 Jun 2015 00:02:58 +0000
treeherderautoland@8cf9d3e497f9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal
bugs1172107
milestone41.0a1
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 1172107 - Add the ability to upload dist files after a successful build; r=ahal This option is configurable to account for the fact that this image supports multiple builds. There is an option for moving files by name in a simple mv $name $name fashion, and for moving files so that any long prefix (containing version/platform information for instance) will be stubbed out: replaced with the word "target."
testing/docker/desktop-build/bin/build.sh
--- a/testing/docker/desktop-build/bin/build.sh
+++ b/testing/docker/desktop-build/bin/build.sh
@@ -42,16 +42,22 @@ set -x -e
 : NEED_XVFB                     ${NEED_XVFB:=false}
 
 : MH_CUSTOM_BUILD_VARIANT_CFG   ${MH_CUSTOM_BUILD_VARIANT_CFG}
 : MH_BRANCH                     ${MH_BRANCH:=mozilla-central}
 : MH_BUILD_POOL                 ${MH_BUILD_POOL:=staging}
 
 : WORKSPACE                     ${WORKSPACE:=/home/worker/workspace}
 
+# files to be "uploaded" (moved to ~/artifacts) from obj-firefox/dist
+: DIST_UPLOADS                  ${DIST_UPLOADS:=""}
+# files which will be be prefixed with target before being sent to artifacts
+# e.g. DIST_TARGET_UPLOADS="a.zip" runs mv v2.0.a.zip mv artifacts/target.a.zip
+: DIST_TARGET_UPLOADS           ${DIST_TARGET_UPLOADS:=""}
+
 set -v
 
 # Don't run the upload step; this is passed through mozharness to mach.  Once
 # the mozharness scripts are not run in Buildbot anymore, this can be moved to
 # Mozharness (or the upload step removed from mach entirely)
 export MOZ_AUTOMATION_UPLOAD=0
 
 export MOZ_CRASHREPORTER_NO_REPORT=1
@@ -82,23 +88,16 @@ tc-vcs checkout $WORKSPACE/build/tools $
 if [ ! -d build ]; then
     mkdir -p build
     ln -s $WORKSPACE/build/tools build/tools
 fi
 
 # and check out mozilla-central where mozharness will use it as a cache (/builds/hg-shared)
 tc-vcs checkout $WORKSPACE/build/src $GECKO_BASE_REPOSITORY $GECKO_HEAD_REPOSITORY $GECKO_HEAD_REV $GECKO_HEAD_REF
 
-# the TC docker worker looks for artifacts to upload in $HOME/artifacts, but
-# mach wants to put them in $WORKSPACE/build/upload; symlinking lets everyone
-# win!
-rm -rf $WORKSPACE/build/upload
-mkdir -p $HOME/artifacts
-ln -s $HOME/artifacts $WORKSPACE/build/upload
-
 # run mozharness in XVfb, if necessary; this is an array to maintain the quoting in the -s argument
 if $NEED_XVFB; then
     # Some mozharness scripts set DISPLAY=:2
     Xvfb :2 -screen 0 1024x768x24 &
     export DISPLAY=:2
     xvfb_pid=$!
     # Only error code 255 matters, because it signifies that no
     # display could be opened. As long as we can open the display
@@ -167,8 +166,23 @@ done
   --no-update \
   --no-upload-files \
   --no-sendchange \
   --log-level=debug \
   --work-dir=$WORKSPACE/build \
   --no-action=generate-build-stats \
   --branch=${MH_BRANCH} \
   --build-pool=${MH_BUILD_POOL}
+
+# upload auxiliary files
+cd $WORKSPACE/build/src/obj-firefox/dist
+
+for file in $DIST_UPLOADS
+do
+    mv $file $HOME/artifacts/$file
+done
+
+# Discard version numbers from packaged files, they just make it hard to write
+# the right filename in the task payload where artifacts are declared
+for file in $DIST_TARGET_UPLOADS
+do
+    mv *.$file $HOME/artifacts/target.$file
+done