Bug 1273634 - Use a generic ubuntu image as a base for the lint image, r?dustin draft
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Wed, 25 May 2016 09:32:10 -0400
changeset 372605 b29bafd0e411cea65f4358f0e0d9f33597dfc129
parent 372307 ea15028498ed95677844fb7f30be5efcaf8b2621
child 522189 d4f68370f712b8091a578b15f9474bfb9c4d0979
push id19535
push userahalberstadt@mozilla.com
push dateSat, 28 May 2016 22:17:12 +0000
reviewersdustin
bugs1273634
milestone49.0a1
Bug 1273634 - Use a generic ubuntu image as a base for the lint image, r?dustin The ES job uses an image based on the official node image. While this was convenient for eslint, it is a bit less convenient for other things. I want to use this image for all lint jobs, and switching the base to a generic ubuntu image seems a bit cleaner. I chose 16.04 for no good reason other than it is the most recent, and we might as well. Node v4.4.5 and taskcluster-vcs have been uploaded to tooltool. MozReview-Commit-ID: GngYeH98zO1
testing/docker/lint/Dockerfile
testing/docker/lint/system-setup.sh
testing/taskcluster/tasks/branches/base_jobs.yml
--- a/testing/docker/lint/Dockerfile
+++ b/testing/docker/lint/Dockerfile
@@ -1,22 +1,23 @@
-FROM          node:4.2
-MAINTAINER    Dave Townsend <dtownsend@oxymoronical.com>
+FROM          ubuntu:16.04
+MAINTAINER    Andrew Halberstadt <ahalberstadt@mozilla.com>
 
 RUN useradd -d /home/worker -s /bin/bash -m worker
 WORKDIR /home/worker
 
-# install necessary npm packages
-RUN           npm install -g taskcluster-vcs@2.3.12
-
 # Install tooltool directly from github.
 RUN mkdir /build
 ADD https://raw.githubusercontent.com/mozilla/build-tooltool/master/tooltool.py /build/tooltool.py
 RUN chmod +rx /build/tooltool.py
 
+# Install lint packages
+ADD           system-setup.sh   /tmp/system-setup.sh
+RUN           bash /tmp/system-setup.sh
+
 # Set variable normally configured at login, by the shells parent process, these
 # are taken from GNU su manual
 ENV           HOME          /home/worker
 ENV           SHELL         /bin/bash
 ENV           USER          worker
 ENV           LOGNAME       worker
 ENV           HOSTNAME      taskcluster-worker
 ENV           LANG          en_US.UTF-8
new file mode 100644
--- /dev/null
+++ b/testing/docker/lint/system-setup.sh
@@ -0,0 +1,62 @@
+#!/usr/bin/env bash
+# This allows ubuntu-desktop to be installed without human interaction
+export DEBIAN_FRONTEND=noninteractive
+
+set -ve
+
+test `whoami` == 'root'
+
+mkdir -p /setup
+cd /setup
+
+apt_packages=()
+apt_packages+=('curl')
+apt_packages+=('mercurial')
+apt_packages+=('python')
+apt_packages+=('xz-utils')
+
+apt-get update
+apt-get install -y ${apt_packages[@]}
+
+tooltool_fetch() {
+    cat >manifest.tt
+    /build/tooltool.py fetch
+    rm manifest.tt
+}
+
+
+###
+# ESLint Setup
+###
+
+# install node
+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 taskcluster-vcs@2.3.12
+tooltool_fetch <<'EOF'
+[
+{
+"size": 6282161,
+"visibility": "public",
+"digest": "a781a96e596f6403eca6ec2300adb9c1a396659393e16993c66f98a658050e557bc681d521f70b50c1162aa4b435274e0098ffcbd37cbe969c0e4f69be19a1e0",
+"algorithm": "sha512",
+"filename": "taskcluster-vcs-v2.3.12.tar.gz"
+}
+]
+EOF
+npm install -g taskcluster-vcs-v2.3.12.tar.gz
+
+cd /
+rm -rf /setup
--- a/testing/taskcluster/tasks/branches/base_jobs.yml
+++ b/testing/taskcluster/tasks/branches/base_jobs.yml
@@ -504,16 +504,17 @@ tasks:
         - '**/*.xml'
         # Run when eslint policies change.
         - '**/.eslintignore'
         - '**/*eslintrc*'
         # The plugin implementing custom checks.
         - 'testing/eslint/eslint-plugin-mozilla/**'
         # Other misc lint related files.
         - 'tools/lint/**'
+        - 'testing/docker/lint/**'
   android-api-15-gradle-dependencies:
     task: tasks/builds/android_api_15_gradle_dependencies.yml
     root: true
     when:
       file_patterns:
         - 'mobile/android/config/**'
         - 'testing/docker/android-gradle-build/**'
         - 'testing/mozharness/configs/builds/releng_sub_android_configs/*gradle_dependencies.py'