summaryrefslogtreecommitdiffstats
path: root/testing/docker/android-gradle-build
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /testing/docker/android-gradle-build
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/docker/android-gradle-build')
-rw-r--r--testing/docker/android-gradle-build/Dockerfile97
-rw-r--r--testing/docker/android-gradle-build/README.md2
-rw-r--r--testing/docker/android-gradle-build/REGISTRY1
-rw-r--r--testing/docker/android-gradle-build/VERSION1
-rw-r--r--testing/docker/android-gradle-build/bin/after.sh45
-rw-r--r--testing/docker/android-gradle-build/bin/before.sh21
-rw-r--r--testing/docker/android-gradle-build/bin/build.sh29
-rw-r--r--testing/docker/android-gradle-build/bin/checkout-script.sh17
-rw-r--r--testing/docker/android-gradle-build/bin/checkout-sources.sh55
-rw-r--r--testing/docker/android-gradle-build/buildprops.json9
-rw-r--r--testing/docker/android-gradle-build/dot-config/pip/pip.conf2
-rw-r--r--testing/docker/android-gradle-build/oauth.txt2
12 files changed, 281 insertions, 0 deletions
diff --git a/testing/docker/android-gradle-build/Dockerfile b/testing/docker/android-gradle-build/Dockerfile
new file mode 100644
index 000000000..b8fb5450f
--- /dev/null
+++ b/testing/docker/android-gradle-build/Dockerfile
@@ -0,0 +1,97 @@
+# TODO remove VOLUME below when the base image is updated next.
+FROM taskcluster/centos6-build-upd:0.1.6.20160329195300
+MAINTAINER Nick Alexander <nalexander@mozilla.com>
+
+# BEGIN ../desktop-build/Dockerfile
+
+# TODO remove when base image is updated
+VOLUME /home/worker/workspace
+VOLUME /home/worker/tooltool-cache
+
+# Add build scripts; these are the entry points from the taskcluster worker, and
+# operate on environment variables
+ADD bin /home/worker/bin
+RUN chmod +x /home/worker/bin/*
+
+# Add wrapper scripts for xvfb allowing tasks to easily retry starting up xvfb
+# %include testing/docker/recipes/xvfb.sh
+ADD topsrcdir/testing/docker/recipes/xvfb.sh /home/worker/scripts/xvfb.sh
+
+# Add configuration
+COPY dot-config /home/worker/.config
+
+# Generate machine uuid file
+RUN dbus-uuidgen --ensure=/var/lib/dbus/machine-id
+
+# Stubbed out credentials; mozharness looks for this file an issues a WARNING
+# if it's not found, which causes the build to fail. Note that this needs to
+# be in the parent of the workspace directory and in the directory where
+# mozharness is run (not its --work-dir). See Bug 1169652.
+ADD oauth.txt /home/worker/
+
+# stubbed out buildprops, which keeps mozharness from choking
+# Note that this needs to be in the parent of the workspace directory and in
+# the directory where mozharness is run (not its --work-dir)
+ADD buildprops.json /home/worker/
+
+# install tooltool directly from github where tooltool_wrapper.sh et al. expect
+# to find it
+RUN wget -O /builds/tooltool.py https://raw.githubusercontent.com/mozilla/build-tooltool/master/tooltool.py
+RUN chmod +x /builds/tooltool.py
+
+# END ../desktop-build/Dockerfile
+
+# Reset user/workdir from parent image so we can install software.
+WORKDIR /
+USER root
+
+# Update base.
+RUN yum upgrade -y
+
+# Install JDK and Sonatype Nexus. Cribbed directly from
+# https://github.com/sonatype/docker-nexus/blob/fffd2c61b2368292040910c055cf690c8e76a272/oss/Dockerfile.
+
+# Install the screen package here to use with xvfb.
+# Move installation to base centos6-build image once Bug 1272629 is fixed
+RUN yum install -y \
+ createrepo \
+ curl \
+ java-1.7.0-openjdk-devel \
+ java-1.7.0-openjdk \
+ screen \
+ sudo \
+ tar \
+ unzip \
+ wget \
+ zip \
+ && yum clean all
+
+ENV NEXUS_VERSION 2.12.0-01
+ENV NEXUS_SHA1SUM 1a9aaad8414baffe0a2fd46eed1f41b85f4049e6
+
+RUN mkdir -p /opt/sonatype/nexus
+
+WORKDIR /tmp
+RUN curl --fail --silent --location --retry 3 \
+ https://download.sonatype.com/nexus/oss/nexus-${NEXUS_VERSION}-bundle.tar.gz \
+ -o /tmp/nexus-${NEXUS_VERSION}-bundle.tar.gz
+
+# Observe the two spaces below. Seriously.
+RUN echo "${NEXUS_SHA1SUM} nexus-${NEXUS_VERSION}-bundle.tar.gz" > nexus-${NEXUS_VERSION}-bundle.tar.gz.sha1
+RUN sha1sum --check nexus-${NEXUS_VERSION}-bundle.tar.gz.sha1
+
+RUN tar zxf nexus-${NEXUS_VERSION}-bundle.tar.gz \
+ && mv /tmp/nexus-${NEXUS_VERSION}/* /opt/sonatype/nexus/ \
+ && rm -rf /tmp/nexus-${NEXUS_VERSION} \
+ && rm -rf /tmp/nexus-${NEXUS_VERSION}-bundle.tar.gz
+
+# 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
+
+# Back to the centos6-build workdir, matching desktop-build.
+WORKDIR /home/worker
+
+# Set a default command useful for debugging
+CMD ["/bin/bash", "--login"]
diff --git a/testing/docker/android-gradle-build/README.md b/testing/docker/android-gradle-build/README.md
new file mode 100644
index 000000000..6096b0836
--- /dev/null
+++ b/testing/docker/android-gradle-build/README.md
@@ -0,0 +1,2 @@
+This is a docker script for fetching Android Gradle dependenices for
+use in Mozilla's build clusters.
diff --git a/testing/docker/android-gradle-build/REGISTRY b/testing/docker/android-gradle-build/REGISTRY
new file mode 100644
index 000000000..cb1e1bb48
--- /dev/null
+++ b/testing/docker/android-gradle-build/REGISTRY
@@ -0,0 +1 @@
+taskcluster
diff --git a/testing/docker/android-gradle-build/VERSION b/testing/docker/android-gradle-build/VERSION
new file mode 100644
index 000000000..8acdd82b7
--- /dev/null
+++ b/testing/docker/android-gradle-build/VERSION
@@ -0,0 +1 @@
+0.0.1
diff --git a/testing/docker/android-gradle-build/bin/after.sh b/testing/docker/android-gradle-build/bin/after.sh
new file mode 100644
index 000000000..5fbbfa701
--- /dev/null
+++ b/testing/docker/android-gradle-build/bin/after.sh
@@ -0,0 +1,45 @@
+#!/bin/bash -vex
+
+set -x -e
+
+: WORKSPACE ${WORKSPACE:=/workspace}
+: GRADLE_VERSION ${GRADLE_VERSION:=2.14.1}
+
+set -v
+
+# Package everything up.
+pushd ${WORKSPACE}
+# Not yet. See notes on tooltool below.
+# cp -R /root/.android-sdk android-sdk-linux
+# tar cJf android-sdk-linux.tar.xz android-sdk-linux
+
+cp -R /workspace/nexus/storage/central jcentral
+tar cJf jcentral.tar.xz jcentral
+
+# The Gradle wrapper will have downloaded and verified the hash of exactly one
+# Gradle distribution. It will be located in $GRADLE_USER_HOME, like
+# ~/.gradle/wrapper/dists/gradle-2.7-all/$PROJECT_HASH/gradle-2.7-all.zip. We
+# want to remove the version from the internal directory for use via tooltool in
+# a mozconfig.
+cp $GRADLE_USER_HOME/wrapper/dists/gradle-${GRADLE_VERSION}-all/*/gradle-${GRADLE_VERSION}-all.zip gradle-${GRADLE_VERSION}-all.zip
+unzip -q gradle-${GRADLE_VERSION}-all.zip
+mv gradle-${GRADLE_VERSION} gradle-dist
+tar cJf gradle-dist.tar.xz gradle-dist
+
+mkdir -p /home/worker/artifacts
+# We can't redistribute the Android SDK publicly just yet. We'll
+# upload to (internal) tooltool eventually. mv
+# android-sdk-linux.tar.xz /home/worker/artifacts
+mv jcentral.tar.xz /home/worker/artifacts
+mv gradle-dist.tar.xz /home/worker/artifacts
+popd
+
+# Bug 1245170: at some point in the future, we'll be able to upload
+# things directly to tooltool.
+# pushd /home/worker/artifacts
+# /build/tooltool.py add --visibility=public jcentral.tar.xz
+# /build/tooltool.py add --visibility=public gradle-dist.tar.xz
+# /build/tooltool.py add --visibility=internal android-sdk-linux.tar.xz
+# /build/tooltool.py upload -v --url=http://relengapi/tooltool/ \
+# --message="No message - Gradle and jcentral archives uploaded from taskcluster."
+# popd
diff --git a/testing/docker/android-gradle-build/bin/before.sh b/testing/docker/android-gradle-build/bin/before.sh
new file mode 100644
index 000000000..c8669db01
--- /dev/null
+++ b/testing/docker/android-gradle-build/bin/before.sh
@@ -0,0 +1,21 @@
+#!/bin/bash -vex
+
+set -x -e
+
+: WORKSPACE ${WORKSPACE:=/workspace}
+: GRADLE_VERSION ${GRADLE_VERSION:=2.7}
+
+set -v
+
+# Frowned upon, but simplest.
+RUN_AS_USER=root NEXUS_WORK=${WORKSPACE}/nexus /opt/sonatype/nexus/bin/nexus restart
+
+# Wait "a while" for Nexus to actually start. Don't fail if this fails.
+wget --quiet --retry-connrefused --waitretry=2 --tries=100 \
+ http://localhost:8081/nexus/service/local/status || true
+rm -rf status
+
+# Verify Nexus has actually started. Fail if this fails.
+curl --fail --silent --location http://localhost:8081/nexus/service/local/status | grep '<state>STARTED</state>'
+
+export JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64
diff --git a/testing/docker/android-gradle-build/bin/build.sh b/testing/docker/android-gradle-build/bin/build.sh
new file mode 100644
index 000000000..797be39f8
--- /dev/null
+++ b/testing/docker/android-gradle-build/bin/build.sh
@@ -0,0 +1,29 @@
+#! /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
+ if [ -d $cache ]; then
+ # -R probably isn't necessary forever, but it fixes some poisoned
+ # caches for now
+ chown -R worker:worker $cache
+ fi
+ 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
+
+. $WORKSPACE/build/src/taskcluster/scripts/builder/build-linux.sh
diff --git a/testing/docker/android-gradle-build/bin/checkout-script.sh b/testing/docker/android-gradle-build/bin/checkout-script.sh
new file mode 100644
index 000000000..2bacf3f01
--- /dev/null
+++ b/testing/docker/android-gradle-build/bin/checkout-script.sh
@@ -0,0 +1,17 @@
+#! /bin/bash -vex
+
+set -x -e
+
+# Inputs, with defaults
+
+: GECKO_HEAD_REPOSITORY ${GECKO_HEAD_REPOSITORY:=https://hg.mozilla.org/mozilla-central}
+: GECKO_HEAD_REV ${GECKO_HEAD_REV:=default}
+
+: SCRIPT_DOWNLOAD_PATH ${SCRIPT_DOWNLOAD_PATH:=$PWD}
+: SCRIPT_PATH ${SCRIPT_PATH:?"script path must be set"}
+set -v
+
+# download script from the gecko repository
+url=${GECKO_HEAD_REPOSITORY}/raw-file/${GECKO_HEAD_REV}/${SCRIPT_PATH}
+wget --directory-prefix=${SCRIPT_DOWNLOAD_PATH} $url
+chmod +x `basename ${SCRIPT_PATH}`
diff --git a/testing/docker/android-gradle-build/bin/checkout-sources.sh b/testing/docker/android-gradle-build/bin/checkout-sources.sh
new file mode 100644
index 000000000..ce5d641d1
--- /dev/null
+++ b/testing/docker/android-gradle-build/bin/checkout-sources.sh
@@ -0,0 +1,55 @@
+#! /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
+# 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
+
+# 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/src
+tc-vcs checkout $GECKO_DIR $GECKO_BASE_REPOSITORY $GECKO_HEAD_REPOSITORY $GECKO_HEAD_REV $GECKO_HEAD_REF
diff --git a/testing/docker/android-gradle-build/buildprops.json b/testing/docker/android-gradle-build/buildprops.json
new file mode 100644
index 000000000..f38b7d788
--- /dev/null
+++ b/testing/docker/android-gradle-build/buildprops.json
@@ -0,0 +1,9 @@
+{
+ "properties": {
+ "buildername": ""
+ },
+ "sourcestamp": {
+ "changes": []
+ },
+ "comments": "TaskCluster Job"
+}
diff --git a/testing/docker/android-gradle-build/dot-config/pip/pip.conf b/testing/docker/android-gradle-build/dot-config/pip/pip.conf
new file mode 100644
index 000000000..73c2b2a52
--- /dev/null
+++ b/testing/docker/android-gradle-build/dot-config/pip/pip.conf
@@ -0,0 +1,2 @@
+[global]
+disable-pip-version-check = true
diff --git a/testing/docker/android-gradle-build/oauth.txt b/testing/docker/android-gradle-build/oauth.txt
new file mode 100644
index 000000000..e56c71f57
--- /dev/null
+++ b/testing/docker/android-gradle-build/oauth.txt
@@ -0,0 +1,2 @@
+taskcluster_clientId = None
+taskcluster_accessToken = None