Bug 1119387 part 1: Move basic build setup to a separate script.
authorWander Lairson Costa <wcosta@mozilla.com>
Wed, 25 Mar 2015 14:25:27 -0300
changeset 265942 a22c81667a6f90d4e2faf410fa69287c1be914b6
parent 265939 cdd2cf9d2d4eafb21a2b640e40f82edb4e697bd6
child 265943 04a63a93948e61edf577088b963344fbc1e1c45f
push id830
push userraliiev@mozilla.com
push dateFri, 19 Jun 2015 19:24:37 +0000
treeherdermozilla-release@932614382a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1119387
milestone39.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 1119387 part 1: Move basic build setup to a separate script. In order to avoid code duplication for additional builds, we move the basic build setup to a common script.
testing/taskcluster/scripts/phone-builder/build-phone.sh
testing/taskcluster/scripts/phone-builder/pre-build.sh
--- a/testing/taskcluster/scripts/phone-builder/build-phone.sh
+++ b/testing/taskcluster/scripts/phone-builder/build-phone.sh
@@ -1,57 +1,11 @@
 #! /bin/bash -vex
 
-# Ensure all the scripts in this dir are on the path....
-DIRNAME=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
-PATH=$DIRNAME:$PATH
-
-WORKSPACE=$1
-
-### Check that require variables are defined
-test -d $WORKSPACE
-test $GECKO_HEAD_REPOSITORY # Should be an hg repository url to pull from
-test $GECKO_BASE_REPOSITORY # Should be an hg repository url to clone from
-test $GECKO_HEAD_REV # Should be an hg revision to pull down
-test $MOZHARNESS_REPOSITORY # mozharness repository
-test $MOZHARNESS_REV # mozharness revision
-test $TARGET
-test $VARIANT
-
-. ../builder/setup-ccache.sh
-
-# First check if the mozharness directory is available. This is intended to be
-# used locally in development to test mozharness changes:
-#
-#   $ docker -v your_mozharness:/home/worker/mozharness ...
-#
-if [ ! -d mozharness ]; then
-  tc-vcs checkout mozharness $MOZHARNESS_REPOSITORY $MOZHARNESS_REPOSITORY $MOZHARNESS_REV
-fi
-
-# Figure out where the remote manifest is so we can use caches for it.
-MANIFEST=$(repository-url.py $GECKO_HEAD_REPOSITORY $GECKO_HEAD_REV b2g/config/$TARGET/sources.xml)
-tc-vcs repo-checkout $WORKSPACE/B2G https://git.mozilla.org/b2g/B2G.git $MANIFEST
-
-# Ensure symlink has been created to gecko...
-rm -f $WORKSPACE/B2G/gecko
-ln -s $WORKSPACE/gecko $WORKSPACE/B2G/gecko
-
-debug_flag=""
-if [ 0$B2G_DEBUG -ne 0 ]; then
-  debug_flag='--debug'
-fi
-
-backup_file=$(aws --output=text s3 ls s3://b2g-phone-backups/$TARGET/ | tail -1 | awk '{print $NF}')
-
-if echo $backup_file | grep '\.tar\.bz2'; then
-    aws s3 cp s3://b2g-phone-backups/$TARGET/$backup_file .
-    tar -xjf $backup_file -C $WORKSPACE/B2G
-    rm -f $backup_file
-fi
+. pre-build.sh
 
 ./mozharness/scripts/b2g_build.py \
   --config b2g/taskcluster-phone.py \
   "$debug_flag" \
   --disable-mock \
   --variant=$VARIANT \
   --work-dir=$WORKSPACE/B2G \
   --gaia-languages-file locales/languages_all.json \
new file mode 100755
--- /dev/null
+++ b/testing/taskcluster/scripts/phone-builder/pre-build.sh
@@ -0,0 +1,50 @@
+#! /bin/bash -vex
+
+# Ensure all the scripts in this dir are on the path....
+DIRNAME=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
+PATH=$DIRNAME:$PATH
+
+WORKSPACE=$1
+
+### Check that require variables are defined
+test -d $WORKSPACE
+test $GECKO_HEAD_REPOSITORY # Should be an hg repository url to pull from
+test $GECKO_BASE_REPOSITORY # Should be an hg repository url to clone from
+test $GECKO_HEAD_REV # Should be an hg revision to pull down
+test $MOZHARNESS_REPOSITORY # mozharness repository
+test $MOZHARNESS_REV # mozharness revision
+test $TARGET
+test $VARIANT
+
+. ../builder/setup-ccache.sh
+
+# First check if the mozharness directory is available. This is intended to be
+# used locally in development to test mozharness changes:
+#
+#   $ docker -v your_mozharness:/home/worker/mozharness ...
+#
+if [ ! -d mozharness ]; then
+  tc-vcs checkout mozharness $MOZHARNESS_REPOSITORY $MOZHARNESS_REPOSITORY $MOZHARNESS_REV
+fi
+
+# Figure out where the remote manifest is so we can use caches for it.
+MANIFEST=$(repository-url.py $GECKO_HEAD_REPOSITORY $GECKO_HEAD_REV b2g/config/$TARGET/sources.xml)
+tc-vcs repo-checkout $WORKSPACE/B2G https://git.mozilla.org/b2g/B2G.git $MANIFEST
+
+# Ensure symlink has been created to gecko...
+rm -f $WORKSPACE/B2G/gecko
+ln -s $WORKSPACE/gecko $WORKSPACE/B2G/gecko
+
+debug_flag=""
+if [ 0$B2G_DEBUG -ne 0 ]; then
+  debug_flag='--debug'
+fi
+
+backup_file=$(aws --output=text s3 ls s3://b2g-phone-backups/$TARGET/ | tail -1 | awk '{print $NF}')
+
+if echo $backup_file | grep '\.tar\.bz2'; then
+    aws s3 cp s3://b2g-phone-backups/$TARGET/$backup_file .
+    tar -xjf $backup_file -C $WORKSPACE/B2G
+    rm -f $backup_file
+fi
+