2019-01-07 20:23:30 +00:00
# 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/.
2019-01-09 00:36:56 +00:00
# Inspired by:
# https://hub.docker.com/r/runmymind/docker-android-sdk/~/dockerfile/
2019-05-01 20:58:30 +00:00
FROM ubuntu:18.04
2019-01-09 00:36:56 +00:00
MAINTAINER Sebastian Kaspari "skaspari@mozilla.com"
2019-05-01 20:58:30 +00:00
# -- Configuration ----------------------------------------------------------------------
ENV GOOGLE_SDK_VERSION 233
2019-01-09 00:36:56 +00:00
# -- System -----------------------------------------------------------------------------
RUN apt-get update -qq
RUN apt-get install -y openjdk-8-jdk \
curl \
2019-05-01 20:58:30 +00:00
wget \
2019-01-09 00:36:56 +00:00
git \
python \
python-pip \
locales \
unzip
RUN locale-gen en_US.UTF-8
# -- Android SDK ------------------------------------------------------------------------
RUN mkdir -p /opt/android-sdk
WORKDIR /opt
ENV ANDROID_BUILD_TOOLS "28.0.3"
ENV ANDROID_HOME /opt/android-sdk
ENV ANDROID_SDK_HOME /opt/android-sdk
2019-01-07 20:23:30 +00:00
ENV PATH ${ PATH } :${ ANDROID_SDK_HOME } /tools:${ ANDROID_SDK_HOME } /tools/bin:${ ANDROID_SDK_HOME } /platform-tools:/opt/tools:${ ANDROID_SDK_HOME } /build-tools/${ ANDROID_BUILD_TOOLS }
2019-01-09 00:36:56 +00:00
RUN curl -L https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip > sdk.zip \
2019-01-07 20:23:30 +00:00
&& unzip sdk.zip -d ${ ANDROID_SDK_HOME } \
&& rm sdk.zip
2019-01-09 00:36:56 +00:00
RUN mkdir -p /opt/android-sdk/.android/
RUN touch /opt/android-sdk/.android/repositories.cfg
2019-01-07 20:23:30 +00:00
RUN yes | sdkmanager --licenses
RUN sdkmanager --verbose "platform-tools" \
2019-01-09 00:36:56 +00:00
"platforms;android-28" \
2019-01-07 20:23:30 +00:00
" build-tools; ${ ANDROID_BUILD_TOOLS } " \
"extras;android;m2repository" \
2019-01-09 00:36:56 +00:00
"extras;google;m2repository"
2019-01-07 20:23:30 +00:00
2019-01-09 00:36:56 +00:00
# Checkout source code
2019-05-01 20:58:30 +00:00
#RUN git clone https://github.com/mozilla-mobile/fenix.git
RUN git clone https://github.com/rpappalax/fenix.git -b dockerfile-add-test-deps --single-branch
2019-01-07 20:23:30 +00:00
2019-01-09 00:36:56 +00:00
# Build project and run gradle tasks once to pull all dependencies
WORKDIR /opt/fenix
2019-05-01 20:58:30 +00:00
RUN ./gradlew -PversionName= 0.0 --no-daemon assemble test lint
# -- Test tools -------------------------------------------------------------------------
RUN mkdir -p /build/test-tools
WORKDIR /build
ENV TEST_TOOLS /build/test-tools
ENV GOOGLE_SDK_DOWNLOAD ./gcloud.tar.gz
ENV PATH ${ PATH } :${ TEST_TOOLS } :${ TEST_TOOLS } /google-cloud-sdk/bin
RUN curl https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-${ GOOGLE_SDK_VERSION } .0.0-linux-x86_64.tar.gz --output ${ GOOGLE_SDK_DOWNLOAD } \
&& tar -xvf ${ GOOGLE_SDK_DOWNLOAD } -C ${ TEST_TOOLS } \
&& rm -f ${ GOOGLE_SDK_DOWNLOAD } \
&& ${ TEST_TOOLS } /google-cloud-sdk/install.sh --quiet \
&& ${ TEST_TOOLS } /google-cloud-sdk/bin/gcloud --quiet components update
RUN URL_FLANK_BIN = $( curl -s "https://api.github.com/repos/TestArmada/flank/releases/latest" | grep "browser_download_url*" | sed -r "s/\"//g" | cut -d ":" -f3) \
&& wget " https: ${ URL_FLANK_BIN } " -O ${ TEST_TOOLS } /flank.jar \
&& chmod +x ${ TEST_TOOLS } /flank.jar
2019-01-07 20:23:30 +00:00
2019-01-09 00:36:56 +00:00
# -- Post setup -------------------------------------------------------------------------
2019-01-07 20:23:30 +00:00
2019-01-09 00:36:56 +00:00
# Install taskcluster python library (used by decision tasks)
# 5.0.0 is still incompatible with taskclusterProxy, meaning no decision task is able
# to schedule the rest of the Taskcluster tasks. Please upgrade to taskcluster>=5 once
# https://bugzilla.mozilla.org/show_bug.cgi?id=1460015 is fixed
RUN pip install 'taskcluster>=4,<5'
RUN pip install arrow
2019-01-07 20:23:30 +00:00
2019-01-09 00:36:56 +00:00
# -- Cleanup ----------------------------------------------------------------------------
2019-01-07 20:23:30 +00:00
2019-01-09 00:36:56 +00:00
RUN apt-get clean