Bug 1247168 - Use robustcheckout in decision image; r=dustin draft
authorGregory Szorc <gps@mozilla.com>
Wed, 20 Jul 2016 12:10:52 -0700
changeset 392532 05114e4e0e7fbbab2c89f25074abfeb7b9ba62ef
parent 392531 8cd8be43dfd34f2970b47721c3da8e3957a8bfed
child 392533 80621d4833a9d745eaff7da4641dfd4ace8ae1db
push id24049
push userbmo:gps@mozilla.com
push dateMon, 25 Jul 2016 19:51:28 +0000
reviewersdustin
bugs1247168
milestone50.0a1
Bug 1247168 - Use robustcheckout in decision image; r=dustin Now that Mercurial 3.8.4 and robustcheckout are in place, we convert checkout-gecko from tc-vcs to robustcheckout. As part of this, we remove references to tc-vcs from the Docker image. This completes our changes to the decision Docker image. Image size has been reduced from ~725 MB to ~217 MB. Not bad. MozReview-Commit-ID: Hx9d02Al1TP
testing/docker/decision/bin/checkout-gecko
testing/docker/decision/system-setup.sh
--- a/testing/docker/decision/bin/checkout-gecko
+++ b/testing/docker/decision/bin/checkout-gecko
@@ -1,33 +1,31 @@
 #! /bin/bash -e
 
-set -e
+set -ex
 
 # Ensure we have at least enough to check gecko out...
 test $GECKO_BASE_REPOSITORY
 
-# Workspace to checkout gecko into...
-WORKSPACE=$1
-mkdir -p $WORKSPACE
+DESTDIR=$1
 
 res=`curl --fail --retry 5 http://taskcluster/secrets/v1/secret/project/taskcluster/gecko/hgfingerprint`
 FP=`echo $res | jq -r .secret.content`
 
 if [[ ! "$FP" =~ ^[a-f0-9:]+$ ]]; then
     echo
     echo "[taskcluster:error] HG host fingerprint not properly loaded"
     exit 1
 fi
 
-mkdir /etc/mercurial
-cat >/etc/mercurial/hgrc <<EOF
-[hostfingerprints]
-hg.mozilla.org = $FP
-EOF
+if [ -n "${GECKO_HEAD_REV}" ]; then
+  args="--revision ${GECKO_HEAD_REV}"
+else
+  args="--branch ${GECKO_HEAD_REF}"
+fi
 
-# Note that tc-vcs requires only the first two arguments so others are optional.
-# This is intended to make it easier to clone local directories.
-tc-vcs checkout $WORKSPACE/gecko \
-  $GECKO_BASE_REPOSITORY \
-  $GECKO_HEAD_REPOSITORY \
-  $GECKO_HEAD_REV \
-  $GECKO_HEAD_REF
+hg --config hostfingerprints.hg.mozilla.org=${FP} robustcheckout \
+  --sharebase /home/worker/hg-shared \
+  --purge \
+  ${args} \
+  --upstream ${GECKO_BASE_REPOSITORY} \
+  ${GECKO_HEAD_REPOSITORY} \
+  ${DESTDIR}
--- a/testing/docker/decision/system-setup.sh
+++ b/testing/docker/decision/system-setup.sh
@@ -70,30 +70,13 @@ refresh = 1.0
 cacerts = /etc/ssl/certs/ca-certificates.crt
 
 [extensions]
 robustcheckout = /usr/local/mercurial/robustcheckout.py
 EOF
 
 chmod 644 /etc/mercurial/hgrc
 
-# Install node
-tooltool_fetch <<'EOF'
-[
-{
-    "size": 5676610,
-    "digest": "ce27b788dfd141a5ba7674332825fc136fe2c4f49a319dd19b3a87c8fffa7a97d86cbb8535661c9a68c9122719aa969fc6a8c886458a0df9fc822eec99ed130b",
-    "algorithm": "sha512",
-    "filename": "node-v0.10.36-linux-x64.tar.gz"
-}
-]
-
-EOF
-tar -C /usr/local -xz --strip-components 1 < node-*.tar.gz
-node -v  # verify
-
-npm install -g taskcluster-vcs@2.3.34
-
 cd /
 rm -rf $BUILD
 apt-get clean
 apt-get autoclean
 rm $0