mirror of
https://github.com/status-im/react-native.git
synced 2025-01-10 17:45:59 +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
56 lines
1.7 KiB
Docker
56 lines
1.7 KiB
Docker
FROM containership/android-base:latest
|
|
|
|
# set default environment variables
|
|
ENV GRADLE_OPTS="-Dorg.gradle.jvmargs=\"-Xmx512m -XX:+HeapDumpOnOutOfMemoryError\""
|
|
ENV JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF8"
|
|
ENV REACT_NATIVE_MAX_WORKERS=1
|
|
|
|
# add ReactAndroid directory
|
|
ADD .buckconfig /app/.buckconfig
|
|
ADD .buckjavaargs /app/.buckjavaargs
|
|
ADD ReactAndroid /app/ReactAndroid
|
|
ADD ReactCommon /app/ReactCommon
|
|
ADD keystores /app/keystores
|
|
|
|
# set workdir
|
|
WORKDIR /app
|
|
|
|
# run buck fetches
|
|
RUN buck fetch ReactAndroid/src/test/java/com/facebook/react/modules
|
|
RUN buck fetch ReactAndroid/src/main/java/com/facebook/react
|
|
RUN buck fetch ReactAndroid/src/main/java/com/facebook/react/shell
|
|
RUN buck fetch ReactAndroid/src/test/...
|
|
RUN buck fetch ReactAndroid/src/androidTest/...
|
|
|
|
# build app
|
|
RUN buck build ReactAndroid/src/main/java/com/facebook/react
|
|
RUN buck build ReactAndroid/src/main/java/com/facebook/react/shell
|
|
|
|
ADD gradle /app/gradle
|
|
ADD gradlew /app/gradlew
|
|
ADD settings.gradle /app/settings.gradle
|
|
ADD build.gradle /app/build.gradle
|
|
ADD react.gradle /app/react.gradle
|
|
|
|
# run gradle downloads
|
|
RUN ./gradlew :ReactAndroid:downloadBoost :ReactAndroid:downloadDoubleConversion :ReactAndroid:downloadFolly :ReactAndroid:downloadGlog
|
|
|
|
# compile native libs with Gradle script, we need bridge for unit and integration tests
|
|
RUN ./gradlew :ReactAndroid:packageReactNdkLibsForBuck -Pjobs=1 -Pcom.android.build.threadPoolSize=1
|
|
|
|
# add all react-native code
|
|
ADD . /app
|
|
WORKDIR /app
|
|
|
|
# https://github.com/npm/npm/issues/13306
|
|
RUN cd $(npm root -g)/npm && npm install fs-extra && sed -i -e s/graceful-fs/fs-extra/ -e s/fs.rename/fs.move/ ./lib/utils/rename.js
|
|
|
|
# build node dependencies
|
|
RUN npm install
|
|
RUN npm install github@0.2.4
|
|
|
|
WORKDIR /app/website
|
|
RUN npm install
|
|
|
|
WORKDIR /app
|