mirror of
https://github.com/status-im/react-native.git
synced 2025-01-16 04:24:15 +00:00
fe2ff122dc
Summary: Created a containerized environment to run unit and integration tests for both javascript and android as well as a Jenkinsfile using the new 2.0 Pipeline syntax for integration into a Jenkins CI cluster. Here is a quick summary of the changes: * The android image is built from two separate dockerfiles. There is a base image that handles the heavy lifting of dependencies that are infrequently changed while the secondary image extends the base and allows for much quicker incremental builds on code updates. * The javascript image is simple and is relatively quick to build, therefore there is no base image for any react specific javascript dependencies and it is all packaged in a single docker image. * A new `scripts/docker` has been created including some javascript files and shell scripts to aid in the running of the tests * The instrumentation test runner script can be passed various flags to control which tests run since the entire suite takes a significant amount of time to run synchronously * Jen Closes https://github.com/facebook/react-native/pull/11902 Differential Revision: D4609238 Pulled By: ericvicenti fbshipit-source-id: a317f3ac3be898180b009254a9604ca7d579a8b9
79 lines
2.3 KiB
Docker
79 lines
2.3 KiB
Docker
FROM library/ubuntu:16.04
|
|
|
|
# set default build arguments
|
|
ARG ANDROID_VERSION=25.2.3
|
|
ARG BUCK_VERSION=2016.11.11.01
|
|
ARG NDK_VERSION=10e
|
|
ARG NODE_VERSION=6.2.0
|
|
ARG WATCHMAN_VERSION=4.7.0
|
|
|
|
# set default environment variables
|
|
ENV ADB_INSTALL_TIMEOUT=10
|
|
ENV PATH=${PATH}:/opt/buck/bin/
|
|
ENV ANDROID_HOME=/opt/android
|
|
ENV ANDROID_SDK_HOME=${ANDROID_HOME}
|
|
ENV PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools
|
|
ENV ANDROID_NDK=/opt/ndk/android-ndk-r$NDK_VERSION
|
|
ENV PATH=${PATH}:${ANDROID_NDK}
|
|
|
|
# install system dependencies
|
|
RUN apt-get update && apt-get install ant autoconf automake curl g++ gcc git libqt5widgets5 lib32z1 lib32stdc++6 make maven npm openjdk-8* python-dev python3-dev qml-module-qtquick-controls qtdeclarative5-dev unzip -y
|
|
|
|
# configure npm
|
|
RUN npm config set spin=false
|
|
RUN npm config set progress=false
|
|
|
|
# install node
|
|
RUN npm install n -g
|
|
RUN n $NODE_VERSION
|
|
|
|
# download buck
|
|
RUN git clone https://github.com/facebook/buck.git /opt/buck
|
|
WORKDIR /opt/buck
|
|
RUN git checkout v$BUCK_VERSION
|
|
|
|
# build buck
|
|
RUN ant
|
|
|
|
# download watchman
|
|
RUN git clone https://github.com/facebook/watchman.git /opt/watchman
|
|
WORKDIR /opt/watchman
|
|
RUN git checkout v$WATCHMAN_VERSION
|
|
|
|
# build watchman
|
|
RUN ./autogen.sh
|
|
RUN ./configure
|
|
RUN make
|
|
RUN make install
|
|
|
|
# download and unpack android
|
|
RUN mkdir /opt/android
|
|
WORKDIR /opt/android
|
|
RUN curl --silent https://dl.google.com/android/repository/tools_r$ANDROID_VERSION-linux.zip > android.zip
|
|
RUN unzip android.zip
|
|
RUN rm android.zip
|
|
|
|
# download and unpack NDK
|
|
RUN mkdir /opt/ndk
|
|
WORKDIR /opt/ndk
|
|
RUN curl --silent https://dl.google.com/android/repository/android-ndk-r$NDK_VERSION-linux-x86_64.zip > ndk.zip
|
|
RUN unzip ndk.zip
|
|
|
|
# cleanup NDK
|
|
RUN rm ndk.zip
|
|
|
|
# add android SDK tools
|
|
# 2 - Android SDK Platform-tools, revision 25.0.3
|
|
# 12 - Android SDK Build-tools, revision 23.0.1
|
|
# 35 - SDK Platform Android 6.0, API 23, revision 3
|
|
# 39 - SDK Platform Android 4.4.2, API 19, revision 4
|
|
# 102 - ARM EABI v7a System Image, Android API 19, revision 5
|
|
# 103 - Intel x86 Atom System Image, Android API 19, revision 5
|
|
# 131 - Google APIs, Android API 23, revision 1
|
|
# 166 - Android Support Repository, revision 41
|
|
RUN echo "y" | android update sdk -u -a -t 2,12,35,39,102,103,131,166
|
|
RUN ln -s /opt/android/platform-tools/adb /usr/bin/adb
|
|
|
|
# clean up unnecessary directories
|
|
RUN rm -rf /opt/android/system-images/android-19/default/x86
|