Bug 1248713 - add docker container for l10n repacks r=catlee DONTBUILD
authorVarun Joshi <varunj.1011@gmail.com>
Fri, 04 Mar 2016 13:30:59 -0500
changeset 323280 26fe286d51cd1282d310d0452c177373c9a439eb
parent 323279 bd154748b83a56ee103c21a324b5bd1c4cc28492
child 323281 bbab21ac3b8cce6a8748fad28c9b4d42e156216d
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscatlee
bugs1248713
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1248713 - add docker container for l10n repacks r=catlee DONTBUILD
testing/docker/desktop-build/bin/checkout-sources.sh
testing/docker/desktop-l10n/Dockerfile
testing/docker/desktop-l10n/bin/build.sh
testing/docker/desktop-l10n/bin/checkout-sources.sh
testing/docker/desktop-l10n/buildprops.json
testing/docker/desktop-l10n/oauth.txt
--- a/testing/docker/desktop-build/bin/checkout-sources.sh
+++ b/testing/docker/desktop-build/bin/checkout-sources.sh
@@ -1,16 +1,16 @@
 #! /bin/bash -vex
 
 set -x -e
 
 # Inputs, with defaults
 
-# mozharness builds use three repositories: gecko (source), mozharness (build
-# scripts) and tools (miscellaneous) for each, specify *_REPOSITORY.  If the
+# mozharness builds use two repositories: gecko (source)
+# and build-tools (miscellaneous) for each, specify *_REPOSITORY.  If the
 # revision is not in the standard repo for the codebase, specify *_BASE_REPO as
 # the canonical repo to clone and *_HEAD_REPO as the repo containing the
 # desired revision.  For Mercurial clones, only *_HEAD_REV is required; for Git
 # clones, specify the branch name to fetch as *_HEAD_REF and the desired sha1
 # as *_HEAD_REV.
 
 : GECKO_REPOSITORY              ${GECKO_REPOSITORY:=https://hg.mozilla.org/mozilla-central}
 : GECKO_BASE_REPOSITORY         ${GECKO_BASE_REPOSITORY:=${GECKO_REPOSITORY}}
new file mode 100644
--- /dev/null
+++ b/testing/docker/desktop-l10n/Dockerfile
@@ -0,0 +1,15 @@
+FROM		taskcluster/centos6-build-upd:0.1.3.20160122142300
+MAINTAINER	Varun Joshi <varunj.1011@gmail.com>
+
+ADD             bin /home/worker/bin
+ADD		.hgrc /home/worker/.hgrc
+RUN             chmod +x /home/worker/bin/* 
+
+# Generate machine uuid file (like how desktop-build does)
+RUN dbus-uuidgen --ensure=/var/lib/dbus/machine-id
+
+ADD		oauth.txt /home/worker
+ADD		buildprops.json /home/worker
+ENV		MOZ_AUTOMATION=1
+
+CMD ["/bin/bash", "--login"]
new file mode 100755
--- /dev/null
+++ b/testing/docker/desktop-l10n/bin/build.sh
@@ -0,0 +1,26 @@
+#! /bin/bash -vex
+
+set -x -e -v
+
+# TODO: when bug 1093833 is solved and tasks can run as non-root, reduce this
+# to a simple fail-if-root check
+if [ $(id -u) = 0 ]; then
+    # each of the caches we have mounted are owned by root, so update that ownership
+    # to 'worker'
+    for cache in /home/worker/.tc-vcs /home/worker/workspace /home/worker/tooltool-cache; do
+        # -R probably isn't necessary forever, but it fixes some poisoned
+        # caches for now
+        chown -R worker:worker $cache
+    done
+
+    # ..then drop privileges by re-running this script
+    exec su worker /home/worker/bin/build.sh
+fi
+
+####
+# The default build works for any fx_desktop_build based mozharness job:
+# via linux-build.sh
+####
+
+. $HOME/bin/checkout-sources.sh
+. $HOME/bin/l10n.sh
new file mode 100755
--- /dev/null
+++ b/testing/docker/desktop-l10n/bin/checkout-sources.sh
@@ -0,0 +1,62 @@
+#! /bin/bash -vex
+
+set -x -e
+
+# Inputs, with defaults
+
+# mozharness builds use two repositories: gecko (source)
+# and build-tools (miscellaneous) for each, specify *_REPOSITORY.  If the
+# revision is not in the standard repo for the codebase, specify *_BASE_REPO as
+# the canonical repo to clone and *_HEAD_REPO as the repo containing the
+# desired revision.  For Mercurial clones, only *_HEAD_REV is required; for Git
+# clones, specify the branch name to fetch as *_HEAD_REF and the desired sha1
+# as *_HEAD_REV.
+
+: GECKO_REPOSITORY              ${GECKO_REPOSITORY:=https://hg.mozilla.org/mozilla-central}
+: GECKO_BASE_REPOSITORY         ${GECKO_BASE_REPOSITORY:=${GECKO_REPOSITORY}}
+: GECKO_HEAD_REPOSITORY         ${GECKO_HEAD_REPOSITORY:=${GECKO_REPOSITORY}}
+: GECKO_HEAD_REV                ${GECKO_HEAD_REV:=default}
+: GECKO_HEAD_REF                ${GECKO_HEAD_REF:=${GECKO_HEAD_REV}}
+
+: TOOLS_REPOSITORY              ${TOOLS_REPOSITORY:=https://hg.mozilla.org/build/tools}
+: TOOLS_BASE_REPOSITORY         ${TOOLS_BASE_REPOSITORY:=${TOOLS_REPOSITORY}}
+: TOOLS_HEAD_REPOSITORY         ${TOOLS_HEAD_REPOSITORY:=${TOOLS_REPOSITORY}}
+: TOOLS_HEAD_REV                ${TOOLS_HEAD_REV:=default}
+: TOOLS_HEAD_REF                ${TOOLS_HEAD_REF:=${TOOLS_HEAD_REV}}
+: TOOLS_DISABLE                 ${TOOLS_DISABLE:=false}
+
+: WORKSPACE                     ${WORKSPACE:=/home/worker/workspace}
+
+set -v
+
+# check out tools where mozharness expects it to be ($PWD/build/tools and $WORKSPACE/build/tools)
+if [ ! "$TOOLS_DISABLE" = true ]
+then
+    tc-vcs checkout $WORKSPACE/build/tools $TOOLS_BASE_REPOSITORY $TOOLS_HEAD_REPOSITORY $TOOLS_HEAD_REV $TOOLS_HEAD_REF
+
+    if [ ! -d build ]; then
+        mkdir -p build
+        ln -s $WORKSPACE/build/tools build/tools
+    fi
+fi
+
+# desktop_l10n.py expects /builds/tooltool.py to be present
+if ! [ -f /builds/tooltool.py ]
+then
+    git clone https://github.com/mozilla/build-tooltool
+    cp build-tooltool/tooltool.py /builds
+fi
+
+# TODO - include tools repository in EXTRA_CHECKOUT_REPOSITORIES list
+for extra_repo in $EXTRA_CHECKOUT_REPOSITORIES; do
+    BASE_REPO="${extra_repo}_BASE_REPOSITORY"
+    HEAD_REPO="${extra_repo}_HEAD_REPOSITORY"
+    HEAD_REV="${extra_repo}_HEAD_REV"
+    HEAD_REF="${extra_repo}_HEAD_REF"
+    DEST_DIR="${extra_repo}_DEST_DIR"
+
+    tc-vcs checkout ${!DEST_DIR} ${!BASE_REPO} ${!HEAD_REPO} ${!HEAD_REV} ${!HEAD_REF}
+done
+
+export GECKO_DIR=$WORKSPACE/build/mozilla-central
+tc-vcs checkout $GECKO_DIR $GECKO_BASE_REPOSITORY $GECKO_HEAD_REPOSITORY $GECKO_HEAD_REV $GECKO_HEAD_REF
new file mode 100644
--- /dev/null
+++ b/testing/docker/desktop-l10n/buildprops.json
@@ -0,0 +1,9 @@
+{
+  "properties": {
+    "buildername": ""
+  },
+  "sourcestamp": {
+    "changes": []
+  },
+  "comments": "TaskCluster Job"
+}
new file mode 100644
--- /dev/null
+++ b/testing/docker/desktop-l10n/oauth.txt
@@ -0,0 +1,2 @@
+taskcluster_clientId = None
+taskcluster_accessToken = None