Bug 1247168 - Use robustcheckout in decision image; r=dustin draft
authorGregory Szorc <gps@mozilla.com>
Wed, 20 Jul 2016 12:10:52 -0700
changeset 390185 da80d775e2fe398c5b2fb57a8237a28a45019f19
parent 390184 d53006237620996e2cd21952a9ebd582c36af135
child 390186 c850047c5ed2a528c72c4809aebc5cd1e1a783cc
push id23614
push userbmo:gps@mozilla.com
push dateWed, 20 Jul 2016 19:22:19 +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 ~209 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,11 +1,11 @@
 #! /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
 
@@ -13,21 +13,21 @@ res=`curl --fail --retry 5 http://taskcl
 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} \
+  ${WORKSPACE}/gecko
--- a/testing/docker/decision/system-setup.sh
+++ b/testing/docker/decision/system-setup.sh
@@ -67,30 +67,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