Bug 1247168 - Use robustcheckout in decision image; r?dustin draft
authorGregory Szorc <gps@mozilla.com>
Tue, 19 Jul 2016 15:54:50 -0700
changeset 390095 45d7c078b2b4f61b7e605e02cb19a39ef4282f20
parent 390094 3b9d10eb283b6b987c2f7b01a86ed7b5b3ba944e
child 390096 43b9be0e12b5d29c477ed97b4b2458800f3b7714
push id23598
push userbmo:gps@mozilla.com
push dateWed, 20 Jul 2016 17:42:45 +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
@@ -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
@@ -65,30 +65,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