Bug 1289249 - Extract tooltool_fetch to its own shell script; r?dustin draft
authorGregory Szorc <gps@mozilla.com>
Wed, 28 Sep 2016 21:45:25 -0700
changeset 419534 5f397c7dbed70a4d0d81dd54eca008c9e3161c94
parent 419533 356f94ba1879d0c40cb234500ef903c10eccbb31
child 419535 3d383872377f8961de4dfe8df8ebc0dde78a9f01
push id30957
push userbmo:gps@mozilla.com
push dateFri, 30 Sep 2016 16:24:29 +0000
reviewersdustin
bugs1289249
milestone52.0a1
Bug 1289249 - Extract tooltool_fetch to its own shell script; r?dustin I will add more stuff to common.sh in the future in order to justify its existence. Not in this bug though. MozReview-Commit-ID: Lx7MJwBMH0w
testing/docker/desktop1604-test/Dockerfile
testing/docker/recipes/common.sh
testing/docker/recipes/ubuntu1604-test-system-setup.sh
--- a/testing/docker/desktop1604-test/Dockerfile
+++ b/testing/docker/desktop1604-test/Dockerfile
@@ -5,16 +5,19 @@ RUN useradd -d /home/worker -s /bin/bash
 WORKDIR /home/worker
 
 # %include testing/docker/recipes/tooltool.py
 ADD topsrcdir/testing/docker/recipes/tooltool.py /setup/tooltool.py
 
 # %include testing/mozharness/external_tools/robustcheckout.py
 ADD topsrcdir/testing/mozharness/external_tools/robustcheckout.py /usr/local/mercurial/robustcheckout.py
 
+# %include testing/docker/recipes/common.sh
+ADD topsrcdir/testing/docker/recipes/common.sh /setup/common.sh
+
 # %include testing/docker/recipes/install-mercurial.sh
 ADD topsrcdir/testing/docker/recipes/install-mercurial.sh /setup/install-mercurial.sh
 
 # %include testing/docker/recipes/ubuntu1604-test-system-setup.sh
 ADD topsrcdir/testing/docker/recipes/ubuntu1604-test-system-setup.sh /setup/system-setup.sh
 RUN           bash /setup/system-setup.sh
 
 # Add wrapper scripts for xvfb allowing tasks to easily retry starting up xvfb
new file mode 100644
--- /dev/null
+++ b/testing/docker/recipes/common.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+tooltool_fetch() {
+    cat >manifest.tt
+    python /setup/tooltool.py fetch
+    rm manifest.tt
+}
--- a/testing/docker/recipes/ubuntu1604-test-system-setup.sh
+++ b/testing/docker/recipes/ubuntu1604-test-system-setup.sh
@@ -85,23 +85,17 @@ apt_packages+=('python-pip')
 
 apt-get update
 # This allows ubuntu-desktop to be installed without human interaction
 export DEBIAN_FRONTEND=noninteractive
 apt-get install -y -f ${apt_packages[@]}
 
 dpkg-reconfigure locales
 
-# set up tooltool (temporarily)
-tooltool_fetch() {
-    cat >manifest.tt
-    python /setup/tooltool.py fetch
-    rm manifest.tt
-}
-
+. /setup/common.sh
 . /setup/install-mercurial.sh
 
 pip install --upgrade pip
 
 pip install virtualenv
 
 # Install node
 tooltool_fetch <<'EOF'