Bug 1331065 - Upgrade the Lint docker image to node v6.9.1. r?jmaher
MozReview-Commit-ID: KOdYXXERO8p
--- a/taskcluster/docker/desktop1604-test/Dockerfile
+++ b/taskcluster/docker/desktop1604-test/Dockerfile
@@ -11,16 +11,19 @@ ADD topsrcdir/taskcluster/docker/recipes
ADD topsrcdir/testing/mozharness/external_tools/robustcheckout.py /usr/local/mercurial/robustcheckout.py
# %include taskcluster/docker/recipes/common.sh
ADD topsrcdir/taskcluster/docker/recipes/common.sh /setup/common.sh
# %include taskcluster/docker/recipes/install-mercurial.sh
ADD topsrcdir/taskcluster/docker/recipes/install-mercurial.sh /setup/install-mercurial.sh
+# %include taskcluster/docker/recipes/install-node.sh
+ADD topsrcdir/taskcluster/docker/recipes/install-node.sh /setup/install-node.sh
+
# Add the tooltool manifest containing the minidump_stackwalk binary.
# %include testing/config/tooltool-manifests/linux64/releng.manifest
ADD topsrcdir/testing/config/tooltool-manifests/linux64/releng.manifest /tmp/minidump_stackwalk.manifest
# %include taskcluster/docker/recipes/ubuntu1604-test-system-setup.sh
ADD topsrcdir/taskcluster/docker/recipes/ubuntu1604-test-system-setup.sh /setup/system-setup.sh
RUN bash /setup/system-setup.sh
--- a/taskcluster/docker/lint/Dockerfile
+++ b/taskcluster/docker/lint/Dockerfile
@@ -6,16 +6,19 @@ WORKDIR /home/worker
RUN mkdir /build
# %include taskcluster/docker/recipes/tooltool.py
ADD topsrcdir/taskcluster/docker/recipes/tooltool.py /build/tooltool.py
# %include testing/mozharness/external_tools/robustcheckout.py
ADD topsrcdir/testing/mozharness/external_tools/robustcheckout.py /usr/local/mercurial/robustcheckout.py
+# %include taskcluster/docker/recipes/install-node.sh
+ADD topsrcdir/taskcluster/docker/recipes/install-node.sh /build/install-node.sh
+
# %include taskcluster/docker/recipes/install-mercurial.sh
ADD topsrcdir/taskcluster/docker/recipes/install-mercurial.sh /build/install-mercurial.sh
ADD system-setup.sh /tmp/system-setup.sh
# %include tools/lint/flake8/flake8_requirements.txt
ADD topsrcdir/tools/lint/flake8/flake8_requirements.txt /tmp/flake8_requirements.txt
RUN bash /tmp/system-setup.sh
# %include taskcluster/docker/recipes/run-task
--- a/taskcluster/docker/lint/system-setup.sh
+++ b/taskcluster/docker/lint/system-setup.sh
@@ -9,16 +9,17 @@ test `whoami` == 'root'
mkdir -p /setup
cd /setup
apt_packages=()
apt_packages+=('curl')
apt_packages+=('python')
apt_packages+=('python-pip')
apt_packages+=('sudo')
+apt_packages+=('wget')
apt_packages+=('xz-utils')
apt-get update
apt-get install -y ${apt_packages[@]}
# Without this we get spurious "LC_ALL: cannot change locale (en_US.UTF-8)" errors,
# and python scripts raise UnicodeEncodeError when trying to print unicode characters.
locale-gen en_US.UTF-8
@@ -34,32 +35,17 @@ cd /build
. install-mercurial.sh
###
# ESLint Setup
###
# install node
-# For future reference things like this don't need to be uploaded to tooltool, as long
-# as we verify the hash, we can download it from the external net.
-cd /setup
-tooltool_fetch <<'EOF'
-[
-{
- "size": 8310316,
- "digest": "95f4fa3d9b215348393dfac4a1c5eff72e9ef85dca38eb69cc8e6c1fe5aada0136c3b182dc04ed5c19fb69f0ac7df85d9c4045b9eb382fcb545b0ccacfece25b",
- "algorithm": "sha512",
- "filename": "node-v4.4.5-linux-x64.tar.xz"
-}
-]
-EOF
-tar -C /usr/local --strip-components 1 -xJ < node-*.tar.xz
-node -v # verify
-npm -v
+. install-node.sh
###
# Flake8 Setup
###
cd /setup
pip install --require-hashes -r /tmp/flake8_requirements.txt
new file mode 100644
--- /dev/null
+++ b/taskcluster/docker/recipes/install-node.sh
@@ -0,0 +1,12 @@
+#!/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/.
+
+# This script installs Node v6.
+
+wget https://nodejs.org/dist/v6.9.1/node-v6.9.1-linux-x64.tar.gz
+echo 'a9d9e6308931fa2a2b0cada070516d45b76d752430c31c9198933c78f8d54b17 node-v6.9.1-linux-x64.tar.gz' | sha256sum -c
+tar -C /usr/local -xz --strip-components 1 < node-v6.9.1-linux-x64.tar.gz
+node -v # verify
+npm -v
--- a/taskcluster/docker/recipes/ubuntu1604-test-system-setup.sh
+++ b/taskcluster/docker/recipes/ubuntu1604-test-system-setup.sh
@@ -93,21 +93,17 @@ dpkg-reconfigure locales
. /setup/common.sh
. /setup/install-mercurial.sh
pip install --upgrade pip
pip install virtualenv
-# Install node
-wget https://nodejs.org/dist/v6.9.1/node-v6.9.1-linux-x64.tar.gz
-echo 'a9d9e6308931fa2a2b0cada070516d45b76d752430c31c9198933c78f8d54b17 node-v6.9.1-linux-x64.tar.gz' | sha256sum -c
-tar -C /usr/local -xz --strip-components 1 < node-v6.9.1-linux-x64.tar.gz
-node -v # verify
+. /setup/install-node.sh
# Install custom-built Debian packages. These come from a set of repositories
# packaged in tarballs on tooltool to make them replicable. Because they have
# inter-dependenices, we install all repositories first, then perform the
# installation.
cp /etc/apt/sources.list sources.list.orig
# Install Valgrind (trunk, late Jan 2016) and do some crude sanity