mirror of
https://github.com/expo/turtle.git
synced 2026-11-14 19:12:55 -10:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5c629b3a16 |
No files matched your search
+17
-69
@@ -9,7 +9,7 @@ executors:
|
||||
working_directory: ~/turtle
|
||||
mac:
|
||||
macos: # https://circleci.com/docs/2.0/testing-ios/#supported-xcode-versions
|
||||
xcode: "11.1.0"
|
||||
xcode: '10.1.0'
|
||||
working_directory: /Users/distiller/project
|
||||
shell: /bin/bash -leo pipefail
|
||||
android:
|
||||
@@ -57,8 +57,8 @@ commands:
|
||||
- run:
|
||||
name: Configure aws-cli
|
||||
command: |
|
||||
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
|
||||
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
|
||||
aws configure set aws_access_key_id $AWS_ACCESS_KEY_ID
|
||||
aws configure set aws_secret_access_key $AWS_SECRET_ACCESS_KEY
|
||||
|
||||
setup_nix:
|
||||
steps:
|
||||
@@ -77,49 +77,6 @@ commands:
|
||||
EOF
|
||||
chmod +x /bin/rm
|
||||
|
||||
install_nodejs_mac:
|
||||
parameters:
|
||||
nodejs_version:
|
||||
type: string
|
||||
default: 12.16.1
|
||||
yarn_version:
|
||||
type: string
|
||||
default: 1.22.0
|
||||
steps:
|
||||
- restore_cache:
|
||||
key: "node-js-v1-darwin-archive-<< parameters.nodejs_version >>"
|
||||
- run:
|
||||
name: Uninstall yarn with brew
|
||||
command: brew uninstall --force yarn
|
||||
- install_node_and_yarn:
|
||||
platform: darwin
|
||||
nodejs_version: "<< parameters.nodejs_version >>"
|
||||
yarn_version: "<< parameters.yarn_version >>"
|
||||
- save_cache:
|
||||
key: "node-js-v1-darwin-archive-<< parameters.nodejs_version >>"
|
||||
paths:
|
||||
- /private/tmp/nodejs.tar.xz
|
||||
|
||||
install_node_and_yarn:
|
||||
parameters:
|
||||
platform:
|
||||
type: string
|
||||
nodejs_version:
|
||||
type: string
|
||||
yarn_version:
|
||||
type: string
|
||||
steps:
|
||||
- run:
|
||||
name: Install node & yarn
|
||||
command: |
|
||||
NODEJS_ARCHIVE="/tmp/nodejs.tar.xz"
|
||||
if [ ! -f "$NODEJS_ARCHIVE" ]; then
|
||||
curl -o $NODEJS_ARCHIVE -SL "https://nodejs.org/dist/v<< parameters.nodejs_version >>/node-v<< parameters.nodejs_version >>-<< parameters.platform >>-x64.tar.xz"
|
||||
fi
|
||||
tar -xJf $NODEJS_ARCHIVE -C /usr/local --strip-components=1 --exclude CHANGELOG.md --exclude README.md --exclude LICENSE
|
||||
ln -s /usr/local/bin/node /usr/local/bin/nodejs
|
||||
npm install --global yarn@<< parameters.yarn_version >>
|
||||
|
||||
decrypt_secrets_if_possible:
|
||||
steps:
|
||||
- run:
|
||||
@@ -136,24 +93,18 @@ commands:
|
||||
workingdir:
|
||||
type: string
|
||||
default: .
|
||||
platform:
|
||||
type: string
|
||||
default: linux
|
||||
steps:
|
||||
- restore_cache:
|
||||
key: yarn-v3-<< parameters.platform >>-{{ checksum "<< parameters.workingdir >>/yarn.lock" }}
|
||||
key: yarn-v1-{{ checksum "<< parameters.workingdir >>/yarn.lock" }}
|
||||
|
||||
save_yarn_cache:
|
||||
parameters:
|
||||
workingdir:
|
||||
type: string
|
||||
default: .
|
||||
platform:
|
||||
type: string
|
||||
default: linux
|
||||
steps:
|
||||
- save_cache:
|
||||
key: yarn-v3-<< parameters.platform >>-{{ checksum "<< parameters.workingdir >>/yarn.lock" }}
|
||||
key: yarn-v1-{{ checksum "<< parameters.workingdir >>/yarn.lock" }}
|
||||
paths:
|
||||
- ~/.cache/yarn # `yarn cache dir`
|
||||
|
||||
@@ -164,10 +115,10 @@ commands:
|
||||
default: ios
|
||||
sdk_version:
|
||||
type: string
|
||||
default: sdk37
|
||||
default: sdk32
|
||||
steps:
|
||||
- restore_cache:
|
||||
key: "workingdir-v2-<< parameters.platform >>-<< parameters.sdk_version >>"
|
||||
key: "workingdir-v1-<< parameters.platform >>-<< parameters.sdk_version >>"
|
||||
|
||||
save_workingdir_cache:
|
||||
parameters:
|
||||
@@ -179,10 +130,10 @@ commands:
|
||||
default: ios
|
||||
sdk_version:
|
||||
type: string
|
||||
default: sdk37
|
||||
default: sdk32
|
||||
steps:
|
||||
- save_cache:
|
||||
key: "workingdir-v2-<< parameters.platform >>-<< parameters.sdk_version >>"
|
||||
key: "workingdir-v1-<< parameters.platform >>-<< parameters.sdk_version >>"
|
||||
paths:
|
||||
- "<< parameters.workingdir >>/<< parameters.platform >>/<< parameters.sdk_version >>"
|
||||
|
||||
@@ -229,23 +180,20 @@ jobs:
|
||||
executor: mac
|
||||
steps:
|
||||
- install_nix
|
||||
- install_nodejs_mac
|
||||
- setup
|
||||
- decrypt_secrets_if_possible
|
||||
- restore_yarn_cache:
|
||||
platform: darwin
|
||||
- restore_yarn_cache
|
||||
- run: yarn
|
||||
- save_yarn_cache:
|
||||
platform: darwin
|
||||
- save_yarn_cache
|
||||
- restore_workingdir_cache:
|
||||
sdk_version: sdk37
|
||||
sdk_version: sdk32
|
||||
platform: ios
|
||||
- run:
|
||||
name: Run iOS smoke tests
|
||||
command: SDK_VERSION=sdk37 ./scripts/tests/runIOSSmokeTestsCI.sh
|
||||
command: ./scripts/tests/runIOSSmokeTestsCI.sh
|
||||
- save_workingdir_cache:
|
||||
workingdir: /Users/distiller/project/workingdir
|
||||
sdk_version: sdk37
|
||||
sdk_version: sdk32
|
||||
platform: ios
|
||||
|
||||
android_smoke_tests:
|
||||
@@ -257,11 +205,11 @@ jobs:
|
||||
- run: yarn
|
||||
- save_yarn_cache
|
||||
- restore_workingdir_cache:
|
||||
sdk_version: sdk37
|
||||
sdk_version: sdk32
|
||||
platform: android
|
||||
- run:
|
||||
name: Fetch Android shell app
|
||||
command: SDK_VERSION=sdk37 ./scripts/android/fetchRemoteAndroidTarball.sh
|
||||
command: SDK_VERSION=sdk32 ./scripts/android/fetchRemoteAndroidTarball.sh
|
||||
- run:
|
||||
name: Run Android smoke tests
|
||||
command: |
|
||||
@@ -269,7 +217,7 @@ jobs:
|
||||
--run "./scripts/tests/runAndroidSmokeTestsCI.sh"
|
||||
- save_workingdir_cache:
|
||||
workingdir: ~/turtle/workingdir
|
||||
sdk_version: sdk37
|
||||
sdk_version: sdk32
|
||||
platform: android
|
||||
|
||||
android_staging_deploy:
|
||||
|
||||
@@ -22,6 +22,6 @@ export NODE_ENV=development
|
||||
export EXPO_TURTLE_TOOLS_DIR="$(pwd)/tools"
|
||||
|
||||
PATH_add $EXPO_TURTLE_TOOLS_DIR/bin
|
||||
if [ "$CI" = "true" ] && [[ ! $OSTYPE =~ darwin.* ]]; then
|
||||
if [ "$CI" = "true" ]; then
|
||||
PATH_add $EXPO_TURTLE_TOOLS_DIR/ci/bin
|
||||
fi
|
||||
+2
-3
@@ -1,3 +1,5 @@
|
||||
!/src/node_modules
|
||||
|
||||
node_modules
|
||||
yarn-error.log
|
||||
google-cloud-credentials.json
|
||||
@@ -5,9 +7,6 @@ google-cloud-credentials.json
|
||||
/build/
|
||||
/workingdir/*
|
||||
/artifacts/*
|
||||
.history
|
||||
.vscode/
|
||||
|
||||
shell.apk
|
||||
.secrets*
|
||||
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
"release": true
|
||||
},
|
||||
"hooks": {
|
||||
"before:init": [
|
||||
"yarn"
|
||||
],
|
||||
"after:release": "yarn release:update:turtle-cli-example"
|
||||
}
|
||||
}
|
||||
-230
@@ -7,236 +7,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## Unreleased
|
||||
|
||||
- Updated Android shell app for SDK 38 with `targetSdkVersion` bumped to 29. ([#244](https://github.com/expo/turtle/pull/244))
|
||||
|
||||
## [0.17.0] - 2020-07-16
|
||||
|
||||
### Added
|
||||
|
||||
- `--gradle-args` option for `turtle build:android` which makes it possible to specify custom Gradle arguments.
|
||||
|
||||
### Changed
|
||||
|
||||
- Gradle Wrapper doesn't print when dots when the appropriate version of Gradle is being downloaded.
|
||||
|
||||
## [0.16.2] - 2020-07-01
|
||||
|
||||
### Added
|
||||
|
||||
- Added `--allow-non-https-public-url` to allow bypass of protocol validation on `--public-url`.
|
||||
- Added support for dynamic configs (`app.config.ts`, `app.config.js`).
|
||||
|
||||
## [0.16.0] - 2020-06-25
|
||||
|
||||
### Added
|
||||
|
||||
- Added iOS shell app for Expo SDK38.
|
||||
- Added Android shell app for SDK 38.
|
||||
|
||||
### Removed
|
||||
|
||||
- Dropped support for SDK 34.
|
||||
|
||||
## [0.15.1] - 2020-06-22
|
||||
|
||||
### Changed
|
||||
|
||||
- Configure Turtle to use the Redis CA certificate.
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix announcing supported SDK versions.
|
||||
|
||||
## [0.15.0] - 2020-06-02
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated `@expo/xdl` to 57.9.13 (added \*.bak files clean-up when building .ipa).
|
||||
|
||||
## [0.14.12] - 2020-05-14
|
||||
|
||||
### Changed
|
||||
|
||||
- Update iOS custom client shell app with various fixes.
|
||||
|
||||
## [0.14.11] - 2020-05-04
|
||||
|
||||
### Changed
|
||||
|
||||
- Update SDK 37 iOS shell app with various fixes.
|
||||
|
||||
## [0.14.10] - 2020-05-01
|
||||
|
||||
### Added
|
||||
|
||||
- support for "android.enableDangerousExperimentalLeanBuilds" in app.json.
|
||||
|
||||
## [0.14.9] - 2020-04-21
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated `@expo/xdl` to 57.8.30 (scoped the build command so it only builds the `:app` Android sub-project and not all the sub-projects available, [PR](https://github.com/expo/expo-cli/pull/1937)).
|
||||
|
||||
## [0.14.8] - 2020-04-20
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated `@expo/xdl` to 57.8.29 (removed call to `check-dynamic-macros-android.sh`, [PR](https://github.com/expo/expo-cli/pull/1933)).
|
||||
|
||||
## [0.14.7] - 2020-04-20
|
||||
|
||||
### Changed
|
||||
|
||||
- Turtle no longer installs all dependencies of shell apps projects — only the production dependencies are installed now.
|
||||
- Updated `@expo/xdl` to 57.8.25 (fixed unintuitive `google-services.json` handling for SDK37+, [PR](https://github.com/expo/expo-cli/pull/1897)).
|
||||
|
||||
## [0.14.6] - 2020-04-09
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated @expo/xdl to 57.8.17 (fixed downloading assets smaller than 10 bytes).
|
||||
|
||||
## [0.14.5] - 2020-04-06
|
||||
|
||||
### Changed
|
||||
|
||||
- Made @expo/config error more meaningful.
|
||||
|
||||
## [0.14.4] - 2020-04-06
|
||||
|
||||
### Fixed
|
||||
|
||||
- Determining SDK version for Expo apps using SDK >=37.
|
||||
|
||||
## [0.14.3] - 2020-04-03
|
||||
|
||||
### Fixed
|
||||
|
||||
- A fix for Android SDK 37 - `check-dynamic-macros-android.sh` doesn't use `jq` anymore.
|
||||
|
||||
## [0.14.1] - 2020-04-01
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated iOS shell app for SDK 37 to remove unnecessary unimodules.
|
||||
|
||||
## [0.14.0] - 2020-03-31
|
||||
|
||||
### Added
|
||||
|
||||
- Added iOS shell app for SDK 37.
|
||||
- Added Android shell app for SDK 37.
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated iOS client shell app to support SDK 37.
|
||||
- Replace `/` with `__` in the artifact filename to fix a strange bug with selecting APK file in Android Studio.
|
||||
- Print currently using Java version if it's not 8.
|
||||
|
||||
### Removed
|
||||
|
||||
- Dropped support for SDK 33.
|
||||
|
||||
## [0.13.10] - 2020-03-09
|
||||
|
||||
### Added
|
||||
|
||||
- Added validation for `--public-url`.
|
||||
|
||||
### Changed
|
||||
|
||||
- Changed the way of installing NDK - it's installed with `sdkmanager` now.
|
||||
- Upgraded NDK to 17.2.4988734.
|
||||
- Upgraded Node.js version to 12.16.1.
|
||||
|
||||
### Fixed
|
||||
|
||||
- A bug where the `platform` field in logs wasn't set correctly when using a shortcut command.
|
||||
- Removed all remaining instances of `UIWebView` in iOS app builds.
|
||||
|
||||
### Removed
|
||||
|
||||
- Dropped support for Node.js versions older than 10.
|
||||
- Dropped support for building Expo SDK 31 and 32 apps.
|
||||
|
||||
## [0.13.9] - 2020-02-13
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed Notifications.getDevicePushTokenAsync() erroring occasionally on iOS SDK 36.
|
||||
|
||||
## [0.13.8] - 2020-01-27
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed `react-native-maps` native module not being properly initialized (https://github.com/expo/expo/pull/6844)
|
||||
- Fixed Android standalone apps crashing on startup (https://github.com/expo/expo/pull/6825)
|
||||
|
||||
## [0.13.7] - 2020-01-15
|
||||
|
||||
### Added
|
||||
|
||||
- Bumped `traveling-fastlane` to 1.11.4 to update CA certs
|
||||
|
||||
## [0.13.6] - 2019-12-17
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed issue with missing request handler for assets-library urls.
|
||||
|
||||
## [0.13.4] - 2019-12-13
|
||||
|
||||
### Added
|
||||
|
||||
- Support for building iOS apps with a wildcard provisioning profile.
|
||||
|
||||
## [0.13.3] - 2019-12-12
|
||||
|
||||
### Fixed
|
||||
|
||||
- Removed private API usage from iOS SDK 36 tarball
|
||||
|
||||
## [0.13.2] - 2019-12-10
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed Android App Bundle builds
|
||||
- Fixed issue with Root View Background Color and AppLoading on Android SDK 36 builds
|
||||
|
||||
## [0.13.1] - 2019-12-09
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fixed Android shell app for SDK 36
|
||||
|
||||
## [0.13.0] - 2019-12-09
|
||||
|
||||
### Added
|
||||
|
||||
- Added iOS and Android shell apps for SDK 36
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated iOS client shell app to support SDK 36
|
||||
|
||||
## [0.12.12] - 2019-11-22
|
||||
|
||||
### Fixed
|
||||
|
||||
- A bug that caused `expo.owner` value not to be used if defined.
|
||||
|
||||
## [0.12.11] - 2019-11-20
|
||||
|
||||
### Added
|
||||
|
||||
- Bumped `traveling-fastlane` to 1.11.0
|
||||
|
||||
## [0.12.10] - 2019-11-15
|
||||
|
||||
### Added
|
||||
|
||||
- Add `shellAppSdkVersion` param to `IOSShellAppBuilder` so entitlement keys get properly added in (https://github.com/expo/turtle/pull/162)
|
||||
|
||||
## [0.12.9] - 2019-11-14
|
||||
|
||||
### Added
|
||||
|
||||
+18
-17
@@ -1,28 +1,29 @@
|
||||
# see docker-base/Dockerfile to learn what's installed in the turtle-android-base image
|
||||
FROM gcr.io/exponentjs/turtle-android-base:0.4.0
|
||||
FROM gcr.io/exponentjs/turtle-android-base:0.1.0
|
||||
|
||||
ADD . /app/turtle
|
||||
|
||||
WORKDIR /app/turtle
|
||||
|
||||
RUN ./scripts/fetchRemoteTarballs.sh android
|
||||
|
||||
RUN ln -s /app/turtle/workingdir /app/workingdir && \
|
||||
for SDK_VERSION in `ls /app/workingdir/android/`; do \
|
||||
echo "preparing $SDK_VERSION shell app" && \
|
||||
cd /app/workingdir/android/$SDK_VERSION && \
|
||||
mv packages non-workspace-packages && \
|
||||
# Keep in sync with src/bin/setup/android/index.ts#_installNodeModules
|
||||
# --prod requires --ignore-scripts (otherwise
|
||||
# expo-yarn-workspaces errors as missing)
|
||||
yarn install --ignore-scripts --prod && \
|
||||
mv non-workspace-packages packages ; \
|
||||
done
|
||||
RUN mv /app/turtle/workingdir /app && \
|
||||
for SDK_VERSION in `ls /app/workingdir/android/`; do \
|
||||
echo "preparing $SDK_VERSION shell app" && \
|
||||
cd /app/workingdir/android/$SDK_VERSION && \
|
||||
if [ -f universe-package.json ]; then \
|
||||
mv package.json exponent-package.json && \
|
||||
mv universe-package.json package.json && \
|
||||
yarn install && \
|
||||
mv package.json universe-package.json && \
|
||||
mv exponent-package.json package.json; \
|
||||
else \
|
||||
yarn install; \
|
||||
fi \
|
||||
; done && \
|
||||
mv /app/workingdir /app/turtle
|
||||
|
||||
ENV NODE_ENV "production"
|
||||
ENV TURTLE_WORKING_DIR_PATH /app/turtle/workingdir/
|
||||
|
||||
WORKDIR /app/turtle
|
||||
|
||||
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
ADD redislabs_ca.pem /var/run/config/redislabs-tls/redislabs_ca.pem
|
||||
|
||||
CMD ["/usr/bin/supervisord"]
|
||||
+1
-12
@@ -3,18 +3,7 @@
|
||||
|
||||
const subcommand = process.argv[2];
|
||||
if (subcommand) {
|
||||
let platform;
|
||||
if (subcommand.length === 2) {
|
||||
const letter = subcommand[1];
|
||||
if (letter === 'a') {
|
||||
platform = 'android';
|
||||
} else if (letter === 'i') {
|
||||
platform = 'ios';
|
||||
}
|
||||
} else {
|
||||
const [, maybePlatform] = subcommand.split(':');
|
||||
platform = maybePlatform;
|
||||
}
|
||||
const [, platform] = subcommand.split(':');
|
||||
if (platform === 'ios' || platform === 'android') {
|
||||
// so that logs have correct platform set
|
||||
process.env.PLATFORM = platform;
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
configureAndroidSdk.sh
|
||||
+31
-26
@@ -17,7 +17,6 @@ RUN dpkg --add-architecture i386 && \
|
||||
build-essential\
|
||||
bzip2:i386\
|
||||
file\
|
||||
jq\
|
||||
lib32ncurses5\
|
||||
lib32z1\
|
||||
libc6:i386\
|
||||
@@ -32,7 +31,7 @@ RUN dpkg --add-architecture i386 && \
|
||||
apt-get clean
|
||||
|
||||
ENV NPM_CONFIG_LOGLEVEL warn
|
||||
ENV NODE_VERSION 12.16.1
|
||||
ENV NODE_VERSION 8.12.0
|
||||
|
||||
RUN curl -SLO "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.xz" \
|
||||
&& tar -xJf "node-v$NODE_VERSION-linux-x64.tar.xz" -C /usr/local --strip-components=1 \
|
||||
@@ -55,33 +54,39 @@ ENV PATH ${ANDROID_HOME}/tools:${PATH}
|
||||
ENV PATH ${ANDROID_HOME}/tools/bin:${PATH}
|
||||
ENV PATH ${ANDROID_HOME}/build-tools/28.0.3/:${PATH}
|
||||
|
||||
ADD configureAndroidSdk.sh /tmp/configureAndroidSdk.sh
|
||||
ADD scripts/android/configureAndroidSdk.sh /tmp/configureAndroidSdk.sh
|
||||
RUN /tmp/configureAndroidSdk.sh --install-all-platforms
|
||||
|
||||
# Install Android NDK
|
||||
ENV ANDROID_NDK_VERSION android-ndk-r10e
|
||||
ENV ANDROID_NDK_FILE ${ANDROID_NDK_VERSION}-linux-x86_64.bin
|
||||
ENV ANDROID_NDK_URL https://dl.google.com/android/ndk/${ANDROID_NDK_FILE}
|
||||
ENV ANDROID_NDK /opt/${ANDROID_NDK_VERSION}
|
||||
ENV PATH $ANDROID_NDK:$PATH
|
||||
|
||||
# i have no clue why some of this is here, but it's working elsewhere
|
||||
# it appears to install the NDK version expo needs, so that's cool
|
||||
RUN mkdir /ndk_setup && cd /ndk_setup && \
|
||||
curl -L ${ANDROID_NDK_URL} > ${ANDROID_NDK_FILE} && \
|
||||
chmod +x ${ANDROID_NDK_FILE} && \
|
||||
sync && \
|
||||
./${ANDROID_NDK_FILE} && \
|
||||
mv ./${ANDROID_NDK_VERSION} ${ANDROID_NDK} && \
|
||||
cp -R \
|
||||
${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64 \
|
||||
${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86 && \
|
||||
cp -R \
|
||||
${ANDROID_NDK}/toolchains/x86-4.8/prebuilt/linux-x86_64 \
|
||||
${ANDROID_NDK}/toolchains/x86-4.8/prebuilt/linux-x86 && \
|
||||
cd && rm -rf /ndk_setup
|
||||
|
||||
# Support Gradle
|
||||
ENV TERM dumb
|
||||
|
||||
# Install gradle 5.6.3
|
||||
RUN wget https://services.gradle.org/distributions/gradle-5.6.3-all.zip
|
||||
RUN unzip -qq gradle-5.6.3-all.zip
|
||||
RUN cp -r gradle-5.6.3 /usr/local
|
||||
|
||||
RUN mkdir -p /root/.gradle/wrapper/dists/gradle-5.6.3-all/7wpcz6s7ut7bllr9k6e1hazxc
|
||||
RUN mv gradle-5.6.3-all.zip /root/.gradle/wrapper/dists/gradle-5.6.3-all/7wpcz6s7ut7bllr9k6e1hazxc
|
||||
RUN mv gradle-5.6.3 /root/.gradle/wrapper/dists/gradle-5.6.3-all/7wpcz6s7ut7bllr9k6e1hazxc
|
||||
RUN touch /root/.gradle/wrapper/dists/gradle-5.6.3-all/7wpcz6s7ut7bllr9k6e1hazxc/gradle-5.6.3-all.zip.ok
|
||||
RUN touch /root/.gradle/wrapper/dists/gradle-5.6.3-all/7wpcz6s7ut7bllr9k6e1hazxc/gradle-5.6.3-all.zip.lck
|
||||
RUN chmod 755 /root/.gradle/wrapper/dists/gradle-5.6.3-all/7wpcz6s7ut7bllr9k6e1hazxc/gradle-5.6.3/bin/gradle
|
||||
|
||||
ENV GRADLE_HOME /usr/local/gradle-5.6.3
|
||||
# Install gradle
|
||||
RUN wget https://services.gradle.org/distributions/gradle-4.4-all.zip
|
||||
RUN unzip -qq gradle-4.4-all.zip
|
||||
RUN mv gradle-4.4 /usr/local
|
||||
RUN rm gradle-4.4-all.zip
|
||||
ENV GRADLE_HOME /usr/local/gradle-4.4
|
||||
ENV PATH ${GRADLE_HOME}/bin:$PATH
|
||||
|
||||
# Install gradle 4.10.2
|
||||
RUN wget https://services.gradle.org/distributions/gradle-4.10.2-all.zip
|
||||
RUN mkdir -p /root/.gradle/wrapper/dists/gradle-4.10.2-all/9fahxiiecdb76a5g3aw9oi8rv
|
||||
RUN unzip -qq gradle-4.10.2-all.zip
|
||||
RUN mv gradle-4.10.2-all.zip /root/.gradle/wrapper/dists/gradle-4.10.2-all/9fahxiiecdb76a5g3aw9oi8rv
|
||||
RUN mv gradle-4.10.2 /root/.gradle/wrapper/dists/gradle-4.10.2-all/9fahxiiecdb76a5g3aw9oi8rv
|
||||
RUN touch /root/.gradle/wrapper/dists/gradle-4.10.2-all/9fahxiiecdb76a5g3aw9oi8rv/gradle-4.10.2-all.zip.ok
|
||||
RUN touch /root/.gradle/wrapper/dists/gradle-4.10.2-all/9fahxiiecdb76a5g3aw9oi8rv/gradle-4.10.2-all.zip.lck
|
||||
RUN chmod 755 /root/.gradle/wrapper/dists/gradle-4.10.2-all/9fahxiiecdb76a5g3aw9oi8rv/gradle-4.10.2/bin/gradle
|
||||
@@ -152,8 +152,6 @@ spec:
|
||||
value: '-Xms2048m -XX:+HeapDumpOnOutOfMemoryError -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:+UseG1GC'
|
||||
- name: GRADLE_OPTS
|
||||
value: '-Dorg.gradle.parallel=true -Dorg.gradle.configureondemand=true -Dorg.gradle.daemon=false -Dorg.gradle.jvmargs="-Xms2048m -XX:+HeapDumpOnOutOfMemoryError -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -XX:+UseG1GC"'
|
||||
- name: REDIS_CA_CERTIFICATE
|
||||
value: '/var/run/config/redislabs-tls/redislabs_ca.pem'
|
||||
resources:
|
||||
requests:
|
||||
memory: "8192Mi"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
self: super:
|
||||
|
||||
{
|
||||
nodejs = super.nodejs-12_x;
|
||||
nodejs = super.nodejs-8_x;
|
||||
}
|
||||
+21
-87
@@ -2,78 +2,11 @@ with (import ./default.nix {});
|
||||
|
||||
let
|
||||
|
||||
# These expressions can be deleted when react native depends on version of
|
||||
# ndk present in nixpkgs.
|
||||
os = if stdenv.system == "x86_64-linux" then "linux"
|
||||
else if stdenv.system == "x86_64-darwin" then "macosx" else throw "unsupported system architecture: ${stdenv.system}";
|
||||
ndk_17c_src = if stdenv.isDarwin then fetchurl {
|
||||
url = http://dl.google.com/android/repository/android-ndk-r17c-darwin-x86_64.zip;
|
||||
sha256 = "11iyxgqp017fchn54kkns9mrax73m73xm5wgis266dsq2g36dn73";
|
||||
} else fetchurl {
|
||||
url = https://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip;
|
||||
sha256 = "12b5h5p8b2ia38825dnnacn7b47c0inpys8jp82r42iks3dilm1z";
|
||||
};
|
||||
ndk_runtime_paths = lib.makeBinPath [ coreutils file findutils gawk gnugrep gnused jdk python3 which ]; #+ ":${platform-tools}/platform-tools";
|
||||
ndk = stdenv.mkDerivation {
|
||||
name = "ndk-17c";
|
||||
src = ndk_17c_src;
|
||||
buildInputs = [ unzip autoPatchelfHook makeWrapper python2 ] ++ lib.optional (os == "linux") [ glibc stdenv.cc.cc ncurses5 zlib libcxx.out ];
|
||||
unpackPhase = ''
|
||||
mkdir extractedzip
|
||||
cd extractedzip
|
||||
unpackFile "$src"
|
||||
if [ "$(find . -mindepth 1 -maxdepth 1 -type d | wc -l)" -eq 1 ]
|
||||
then
|
||||
cd "$(find . -mindepth 1 -maxdepth 1 -type d)"
|
||||
fi
|
||||
sourceRoot="$PWD"
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
packageBaseDir=$out/libexec/android-sdk/ndk-bundle
|
||||
mkdir -p $packageBaseDir
|
||||
cd $packageBaseDir
|
||||
cp -av $sourceRoot/* .
|
||||
'' + lib.optionalString (os == "linux") ''
|
||||
patchShebangs .
|
||||
wrapProgram $(pwd)/build/tools/make_standalone_toolchain.py --prefix PATH : "${ndk_runtime_paths}"
|
||||
rm -rf docs tests
|
||||
# Patch the executables of the toolchains, but not the libraries -- they are needed for crosscompiling
|
||||
addAutoPatchelfSearchPath $out/libexec/android-sdk/ndk-bundle/toolchains/renderscript/prebuilt/linux-x86_64/lib64
|
||||
find toolchains -type d -name bin | while read dir
|
||||
do
|
||||
autoPatchelf "$dir"
|
||||
done
|
||||
# fix ineffective PROGDIR / MYNDKDIR determination
|
||||
for i in ndk-build
|
||||
do
|
||||
sed -i -e 's|^PROGDIR=`dirname $0`|PROGDIR=`dirname $(readlink -f $(which $0))`|' $i
|
||||
done
|
||||
# Patch executables
|
||||
autoPatchelf prebuilt/linux-x86_64
|
||||
# wrap
|
||||
for i in ndk-build
|
||||
do
|
||||
wrapProgram "$(pwd)/$i" --prefix PATH : "${ndk_runtime_paths}"
|
||||
done
|
||||
# make some executables available in PATH
|
||||
mkdir -p $out/bin
|
||||
for i in ndk-build
|
||||
do
|
||||
ln -sf ../../libexec/android-sdk/ndk-bundle/$i $out/bin/$i
|
||||
done
|
||||
'';
|
||||
dontStrip = true;
|
||||
dontPatchELF = true;
|
||||
dontAutoPatchelf = true;
|
||||
noAuditTmpdir = true;
|
||||
};
|
||||
ndkRoot = "${ndk}/libexec/android-sdk/ndk-bundle";
|
||||
|
||||
sdk = androidenv.androidPkgs_9_0.androidsdk;
|
||||
sdk_path = if stdenv.isDarwin
|
||||
then "/Library/Android/sdk"
|
||||
else "/Android/Sdk"; # intentional Capital S
|
||||
ndk = androidenv.androidndk_17c.override { fullNDK = true; };
|
||||
ndk_root = "${ndk}/libexec/${ndk.name}";
|
||||
sdk_path = if stdenv.isDarwin
|
||||
then "/Library/Android/sdk"
|
||||
else "/Android/Sdk"; # intentional Capital S
|
||||
|
||||
in
|
||||
|
||||
@@ -90,27 +23,28 @@ mkShell rec {
|
||||
nativeBuildInputs = [
|
||||
awscli
|
||||
curl
|
||||
fastlane
|
||||
git
|
||||
nodejs
|
||||
nodejs-8_x
|
||||
openjdk8
|
||||
yarn
|
||||
];
|
||||
|
||||
passthru = { inherit ndk ndkRoot; };
|
||||
passthru = { inherit ndk; };
|
||||
|
||||
shellHook = ''
|
||||
${./install-ndk-17c.sh} ${ndk} ${ndkRoot}
|
||||
# grep -v = should clean up build logs, see https://stackoverflow.com/a/52464819/1123156
|
||||
yes | ${sdk}/bin/sdkmanager --sdk_root="$ANDROID_SDK_ROOT" "build-tools;28.0.3" | grep -v =
|
||||
'' + lib.optionalString stdenv.isLinux ''
|
||||
for dep in lib lib64; do
|
||||
if [ -L /$dep ] || [ ! -e /$dep ]; then
|
||||
echo "Creating /$dep"
|
||||
ln -s ${stdenv.cc.libc}/$dep /$dep
|
||||
else
|
||||
echo "Using existing /$dep"
|
||||
fi
|
||||
done
|
||||
${./install-ndk-17c.sh} ${ndk} ${ndk_root}
|
||||
yes | ${androidenv.androidsdk_9_0}/bin/sdkmanager --licenses --sdk_root="$ANDROID_SDK_ROOT"
|
||||
yes | ${androidenv.androidsdk_9_0}/bin/sdkmanager --sdk_root="$ANDROID_SDK_ROOT" "platforms;android-28" | grep -v =
|
||||
yes | ${androidenv.androidsdk_9_0}/bin/sdkmanager --sdk_root="$ANDROID_SDK_ROOT" "build-tools;28.0.3" | grep -v =
|
||||
${lib.optionalString stdenv.isLinux ''
|
||||
for dep in lib lib64; do
|
||||
if [ -L /$dep ] || [ ! -e /$dep ]; then
|
||||
echo "Creating /$dep"
|
||||
ln -s ${stdenv.cc.libc}/$dep /$dep
|
||||
else
|
||||
echo "Using existing /$dep"
|
||||
fi
|
||||
done
|
||||
''}
|
||||
'';
|
||||
}
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"url": "https://github.com/NixOS/nixpkgs-channels.git",
|
||||
"rev": "42f0be81ae05a8fe6d6e8e7f1c28652e7746e046",
|
||||
"date": "2020-03-01T07:21:40-03:00",
|
||||
"sha256": "1rxb5kmghkzazqcv4d8yczdiv2srs4r7apx4idc276lcikm0hdmf",
|
||||
"rev": "80738ed9dc0ce48d7796baed5364eef8072c794d",
|
||||
"date": "2018-11-17T11:18:10+01:00",
|
||||
"sha256": "0anmvr6b47gbbyl9v2fn86mfkcwgpbd5lf0yf3drgm8pbv57c1dc",
|
||||
"fetchSubmodules": false
|
||||
}
|
||||
+11
-20
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "turtle-cli",
|
||||
"version": "0.17.0",
|
||||
"version": "0.12.9",
|
||||
"description": "The command-line tool for building standalone Expo apps",
|
||||
"preferGlobal": true,
|
||||
"scripts": {
|
||||
@@ -22,9 +22,7 @@
|
||||
"test:unit": "yarn test --config jest/unit-config.json",
|
||||
"test:smoke": "yarn test --config jest/smoke-config.json --forceExit",
|
||||
"test:smoke:android": "PLATFORM=android yarn test:smoke --testNamePattern=android",
|
||||
"test:smoke:android:record": "PLATFORM=android EXPENV_OVERRIDES=local-common,local,local-queue expenv yarn test:smoke --testNamePattern=android",
|
||||
"test:smoke:ios": "PLATFORM=ios yarn test:smoke --testNamePattern=iOS",
|
||||
"test:smoke:ios:record": "PLATFORM=ios EXPENV_OVERRIDES=local-common,local,local-queue expenv yarn test:smoke --testNamePattern=iOS",
|
||||
"release": "./scripts/release.sh",
|
||||
"release:beta": "./scripts/releaseBeta.sh",
|
||||
"release:update:turtle-cli-example": "./scripts/updateTurtleCliExampleRepo.sh",
|
||||
@@ -55,7 +53,7 @@
|
||||
"react-native"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
"node": ">=8"
|
||||
},
|
||||
"author": "Expo <[email protected]>",
|
||||
"license": "MIT",
|
||||
@@ -70,11 +68,9 @@
|
||||
"@expo/babel-preset-cli": "^0.1.3",
|
||||
"@types/decompress": "^4.2.3",
|
||||
"@types/fs-extra": "^5.0.4",
|
||||
"@types/ioredis": "^4.16.6",
|
||||
"@types/jest": "^23.3.9",
|
||||
"@types/joi": "^13.4.3",
|
||||
"@types/lodash": "^4.14.129",
|
||||
"@types/node-forge": "^0.8.6",
|
||||
"@types/npm-package-arg": "^6.1.0",
|
||||
"@types/progress": "^2.0.1",
|
||||
"@types/raven": "^2.5.1",
|
||||
@@ -88,26 +84,25 @@
|
||||
"@types/webpack-dev-server": "^3.1.7",
|
||||
"@types/which": "^1.3.1",
|
||||
"husky": "^1.3.1",
|
||||
"jest": "^26.1.0",
|
||||
"jest": "^23.6.0",
|
||||
"lint-staged": "^8.1.5",
|
||||
"nock": "^10.0.1",
|
||||
"nodemon": "^2.0.2",
|
||||
"nodemon": "^1.18.11",
|
||||
"release-it": "^12.3.4",
|
||||
"rimraf": "^2.6.2",
|
||||
"ts-jest": "^26.1.2",
|
||||
"ts-jest": "^23.10.4",
|
||||
"ts-node": "^8.0.3",
|
||||
"ts-transformer-imports": "^0.4.1",
|
||||
"tsconfig-paths": "^3.8.0",
|
||||
"tslint": "^5.10.0",
|
||||
"tslint-eslint-rules": "^5.4.0",
|
||||
"ttypescript": "^1.5.6",
|
||||
"typescript": "^3.9.5"
|
||||
"typescript": "^3.4.2"
|
||||
},
|
||||
"dependencies": {
|
||||
"@expo/config": "^3.2.14",
|
||||
"@expo/spawn-async": "^1.4.2",
|
||||
"@expo/xdl": "57.9.25-alpha.1",
|
||||
"@google-cloud/logging-bunyan": "^2.0.3",
|
||||
"@expo/xdl": "56.5.0",
|
||||
"@google-cloud/logging-bunyan": "^0.9.5",
|
||||
"async-retry": "^1.2.1",
|
||||
"aws-sdk": "^2.226.1",
|
||||
"bunyan": "^1.8.12",
|
||||
@@ -118,7 +113,7 @@
|
||||
"decompress": "^4.2.0",
|
||||
"dogapi": "^2.8.3",
|
||||
"fs-extra": "^6.0.0",
|
||||
"ioredis": "^4.17.3",
|
||||
"ioredis": "^3.2.2",
|
||||
"is-semver": "^1.0.8",
|
||||
"joi": "^13.2.0",
|
||||
"lodash": "^4.17.11",
|
||||
@@ -128,17 +123,13 @@
|
||||
"request-progress": "^3.0.0",
|
||||
"request-promise": "^4.2.5",
|
||||
"semver": "^6.0.0",
|
||||
"sharp": "0.24.1",
|
||||
"sharp": "0.22.1",
|
||||
"source-map-support": "^0.5.6",
|
||||
"tar": "^4.4.6",
|
||||
"uuid": "^3.2.1",
|
||||
"which": "^1.3.1"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"@expo/traveling-fastlane-darwin": "1.11.4"
|
||||
},
|
||||
"volta": {
|
||||
"node": "12.16.1",
|
||||
"yarn": "1.22.0"
|
||||
"@expo/traveling-fastlane-darwin": "1.9.9"
|
||||
}
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
this is just a placeholder to simplify deployments
|
||||
@@ -3,8 +3,6 @@
|
||||
set -eo pipefail
|
||||
|
||||
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../.. && pwd )"
|
||||
CONFIGURE_ANDROID_SDK_PATH="$ROOT_DIR/scripts/android/configureAndroidSdk.sh"
|
||||
DOCKER_BASE_DIR="$ROOT_DIR/docker-base"
|
||||
|
||||
IMAGE_TAG="$1"
|
||||
if [[ -z "$IMAGE_TAG" ]]; then
|
||||
@@ -15,12 +13,10 @@ fi
|
||||
IMAGE_VERSION_FULL_NAME="gcr.io/exponentjs/turtle-android-base:$IMAGE_TAG"
|
||||
IMAGE_LATEST_FULL_NAME="gcr.io/exponentjs/turtle-android-base:latest"
|
||||
|
||||
pushd $DOCKER_BASE_DIR > /dev/null
|
||||
cp $CONFIGURE_ANDROID_SDK_PATH .
|
||||
docker build -t "$IMAGE_VERSION_FULL_NAME" -t "$IMAGE_LATEST_FULL_NAME" .
|
||||
pushd $ROOT_DIR > /dev/null
|
||||
echo docker build -f docker-base/Dockerfile -t "$IMAGE_VERSION_FULL_NAME" -t "$IMAGE_LATEST_FULL_NAME" .
|
||||
echo "Successfully built $IMAGE_VERSION_FULL_NAME Docker image"
|
||||
gcloud docker -- push "$IMAGE_VERSION_FULL_NAME"
|
||||
gcloud docker -- push "$IMAGE_LATEST_FULL_NAME"
|
||||
echo gcloud docker -- push "$IMAGE_VERSION_FULL_NAME"
|
||||
echo gcloud docker -- push "$IMAGE_LATEST_FULL_NAME"
|
||||
echo "Successfully pushed $IMAGE_VERSION_FULL_NAME Docker image to GCloud"
|
||||
rm -rf `basename $CONFIGURE_ANDROID_SDK_PATH`
|
||||
popd > /dev/null
|
||||
@@ -18,5 +18,3 @@ yes | $SDKMANAGER \
|
||||
"extras;android;m2repository" \
|
||||
"extras;google;m2repository" \
|
||||
"extras;google;google_play_services" | grep -v '='; [[ ${PIPESTATUS[1]} = 0 ]]
|
||||
|
||||
yes | $SDKMANAGER "ndk;17.2.4988734" | grep -v '='; [[ ${PIPESTATUS[1]} = 0 ]]
|
||||
+1
-1
@@ -14,7 +14,7 @@ PLATFORM=$1
|
||||
yarn
|
||||
yarn run build
|
||||
if [ "$PLATFORM" = "android" ]; then
|
||||
echo "shell apps will be fetched when building a Docker image"
|
||||
$ROOT_DIR/scripts/android/fetchRemoteAndroidTarball.sh
|
||||
elif [ "$PLATFORM" = "ios" ]; then
|
||||
$ROOT_DIR/scripts/ios/fetchRemoteIosTarball.sh
|
||||
fi
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
|
||||
set -ueo pipefail
|
||||
|
||||
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../.. && pwd )"
|
||||
|
||||
export NODE_ENV=test
|
||||
|
||||
export ENVIRONMENT="development"
|
||||
@@ -26,8 +24,4 @@ export REDIS_CONFIG_URL="noop"
|
||||
export DATADOG_DISABLED="true"
|
||||
export TURTLE_SDK_VERSIONS_SECRET_TOKEN="noop"
|
||||
|
||||
pushd $ROOT_DIR/workingdir/android/${SDK_VERSION:-sdk37} >/dev/null 2>&1
|
||||
yarn
|
||||
popd >/dev/null 2>&1
|
||||
|
||||
yarn test:smoke:android
|
||||
@@ -23,6 +23,6 @@ export DATADOG_DISABLED="true"
|
||||
export TURTLE_SDK_VERSIONS_SECRET_TOKEN="noop"
|
||||
|
||||
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../.. && pwd )"
|
||||
$ROOT_DIR/scripts/ios/fetchRemoteIosTarball.sh
|
||||
SDK_VERSION=sdk32 $ROOT_DIR/scripts/ios/fetchRemoteIosTarball.sh
|
||||
|
||||
yarn test:smoke:ios
|
||||
@@ -0,0 +1 @@
|
||||
s3://exp-artifacts/android-shell-builder-89b2d24c86737d5a489c6a18467e31b2f9ce9005.tar.gz
|
||||
@@ -0,0 +1 @@
|
||||
s3://exp-artifacts/android-shell-builder-f796aaffa0b5715079b2950faf26c2ff4e53e4c0.tar.gz
|
||||
@@ -0,0 +1 @@
|
||||
s3://exp-artifacts/android-shell-builder-aebd669d6573b0b3c802871d94cdb8b4116678d2.tar.gz
|
||||
@@ -0,0 +1 @@
|
||||
s3://exp-artifacts/android-shell-builder-a8e204610e5712391336b378f47962bbb0c04164.tar.gz
|
||||
@@ -1 +0,0 @@
|
||||
s3://exp-artifacts/android-shell-builder-bb08bdc180fccd8f90e99dafb4e0ac456232531b.tar.gz
|
||||
@@ -1 +0,0 @@
|
||||
s3://exp-artifacts/android-shell-builder-3cf3cf0707925322bcd667d5ba79120136f9afd8.tar.gz
|
||||
@@ -1 +0,0 @@
|
||||
s3://exp-artifacts/android-shell-builder-6cde8e00cd7bdf7a933cd8aad7f8e86981ea68a2.tar.gz
|
||||
@@ -1 +1 @@
|
||||
s3://exp-artifacts/ios-expo-client-18a58afe742e63f1d2ac71ba21404d8b84e6563e.tar.gz
|
||||
s3://exp-artifacts/ios-expo-client-d31aaf53daca6aa65d8cb1090fb60c73a9c47075.tar.gz
|
||||
@@ -0,0 +1 @@
|
||||
s3://exp-artifacts/ios-shell-builder-sdk-latest-55848298c7332f7586c4281fa691a4ca31548532.tar.gz
|
||||
@@ -0,0 +1 @@
|
||||
s3://exp-artifacts/ios-shell-builder-sdk-latest-edd02214dd84368c197df32a2d30a901d6c766ff.tar.gz
|
||||
@@ -0,0 +1 @@
|
||||
s3://exp-artifacts/ios-shell-builder-sdk-latest-36b57e8ebb96aa8dce286c89bd56e8708eca819d.tar.gz
|
||||
@@ -0,0 +1 @@
|
||||
s3://exp-artifacts/ios-shell-builder-sdk-latest-651588ff3445a5d87b3a5b81ec2977c02b22f3a2.tar.gz
|
||||
@@ -1 +0,0 @@
|
||||
s3://exp-artifacts/ios-shell-builder-sdk-latest-661a51216c2241dcfdd930517968cd1d0e0ee237.tar.gz
|
||||
@@ -1 +0,0 @@
|
||||
s3://exp-artifacts/ios-shell-builder-sdk-latest-30eb0558ff6a77acf56bb045e98b84f6a5e1478a.tar.gz
|
||||
@@ -1 +0,0 @@
|
||||
s3://exp-artifacts/ios-shell-builder-sdk-latest-b0acfb129b4526f771bd0b363f2896b35f007e83.tar.gz
|
||||
@@ -1 +1 @@
|
||||
[{"scope":"https://sqs.us-west-2.amazonaws.com:443","method":"POST","path":"/","body":"Action=ReceiveMessage&MaxNumberOfMessages=1&QueueUrl=https%3A%2F%2Fsqs.us-west-2.amazonaws.com%2F274251141632%2Fturtle_jobs_local_dominik_android_in.fifo&Version=2012-11-05&VisibilityTimeout=30","status":200,"response":"<?xml version=\"1.0\"?><ReceiveMessageResponse xmlns=\"http://queue.amazonaws.com/doc/2012-11-05/\"><ReceiveMessageResult/><ResponseMetadata><RequestId>2f9926f3-9db4-588e-a00a-71f445522996</RequestId></ResponseMetadata></ReceiveMessageResponse>","rawHeaders":["x-amzn-RequestId","2f9926f3-9db4-588e-a00a-71f445522996","Date","Wed, 08 Apr 2020 13:50:35 GMT","Content-Type","text/xml","Content-Length","240"]},{"scope":"https://sqs.us-west-2.amazonaws.com:443","method":"POST","path":"/","body":"Action=ReceiveMessage&MaxNumberOfMessages=1&QueueUrl=https%3A%2F%2Fsqs.us-west-2.amazonaws.com%2F274251141632%2Fturtle_jobs_local_dominik_android_in_priority.fifo&Version=2012-11-05&VisibilityTimeout=30","status":200,"response":"<?xml version=\"1.0\"?><ReceiveMessageResponse xmlns=\"http://queue.amazonaws.com/doc/2012-11-05/\"><ReceiveMessageResult/><ResponseMetadata><RequestId>e42b6179-9846-5d83-9209-367e40aa9c02</RequestId></ResponseMetadata></ReceiveMessageResponse>","rawHeaders":["x-amzn-RequestId","e42b6179-9846-5d83-9209-367e40aa9c02","Date","Wed, 08 Apr 2020 13:50:41 GMT","Content-Type","text/xml","Content-Length","240"]},{"scope":"https://sqs.us-west-2.amazonaws.com:443","method":"POST","path":"/","body":"Action=ReceiveMessage&MaxNumberOfMessages=1&QueueUrl=https%3A%2F%2Fsqs.us-west-2.amazonaws.com%2F274251141632%2Fturtle_jobs_local_dominik_android_in.fifo&Version=2012-11-05&VisibilityTimeout=30","status":200,"response":"<?xml version=\"1.0\"?><ReceiveMessageResponse xmlns=\"http://queue.amazonaws.com/doc/2012-11-05/\"><ReceiveMessageResult><Message><MessageId>093d5a52-932c-4141-958a-4ee8146dadab</MessageId><ReceiptHandle>AQEBq2BDKWkc+YFuyL+qBVQ6RCqne9ndyzDri6BeHTv+HhCU3kOlINEzzqbgrGJXh49AB6lVInGNsI+uc5uMhC61UscDKfFeqgfhDDUftovz6RXwiIj+xRalgP5fPZn94LbY4KmUoCuGCpXu9UlGxOoorYTkLft9AVY6kabCRlXA8SJzzYjUb1s+rtBoWS3Trj/AOIxOy0EqxeEWpBsNKc1yWc9RNbZ8/qABFLMjOzdmr5gaLEDoRJTUZZUEu9TVOxrC54ES+UaCmgVY17Ubmwo884GbHLoyUA+xqSD0Cvify5GCv3xzB+wjB4gGdGUFdOjj</ReceiptHandle><MD5OfBody>f0cb57fa399d2c8e81f8423e93127bdc</MD5OfBody><Body>{"id":"1b148a0a-4a5e-4572-b28a-c31aa018351a","experienceId":"0128bca1-78cf-4cb8-ac00-c07600500254","experienceName":"@dsokal-local/turtle-cli-example","platform":"android","config":{"releaseChannel":"default","buildType":"apk"},"status":"sent-to-queue","sdkVersion":"37.0.0","accountId":"9b473c78-6d0e-4b69-88a8-1c0960287b2f","priority":"normal","credentials":{"keystore":"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 truncated
|
||||
[{"scope":"https://sqs.us-west-2.amazonaws.com:443","method":"POST","path":"/","body":"Action=ReceiveMessage&MaxNumberOfMessages=1&QueueUrl=https%3A%2F%2Fsqs.us-west-2.amazonaws.com%2F274251141632%2Fturtle_jobs_local_dominik_android_in_priority.fifo&Version=2012-11-05&VisibilityTimeout=30","status":200,"response":"<?xml version=\"1.0\"?><ReceiveMessageResponse xmlns=\"http://queue.amazonaws.com/doc/2012-11-05/\"><ReceiveMessageResult><Message><MessageId>fc2fe53d-1447-4304-90e0-60b025ac9687</MessageId><ReceiptHandle>AQEBcOA9S4yhL3ZCaho9Cv+XVqJEbhOaaWJTsOvBD9SOa/NK/248s0+yI9bHro5Ti9WJrnD3H65SdK9eOETFeS/QDaaCMTYkxjvH/1DrSJt2rAptgItmxl8F6N3iDYLqplOQjmautdjCWYXrCLxMDihMHEjcvWNAq0XLAAjlQJvtm5Z8Vji5xXKJP3IpQOV2DvhS/Cqriteaqe6NW5xKwgKHOC52IVTPMSHiJ0ERUf55agntOOJJ7Za7vHdTr+Zjrxl6yVFWKC/cpwYI00OKGj4bArud0buiaD0rtjszLmcPgcwADRsmhfG65p3gLwIwjfclHqSLlmcuY3c+xsu/5VM1YA==</ReceiptHandle><MD5OfBody>c9e8a99bf73407dfa26a2cb81103c26a</MD5OfBody><Body>{"id":"b9f9f814-5603-4dd5-929d-c9eed756c591","experienceId":"531b2db0-4b14-11e9-92d6-95aebd1034a3","experienceName":"@dsokal-local/turtle-cli-example","platform":"android","config":{"releaseChannel":"default"},"status":"sent-to-queue","sdkVersion":"32.0.0","accountId":"4c44c9d8-3cb6-4980-8505-ca0637cf3165","priority":"high","credentials":{"keystore":"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","keyPassword":"fb7409988d78459c826cf2a438cb3a33","keystoreAlias":"QGRzb2thbC1sb2NhbC90dXJ0bGUtY2xpLWV4YW1wbGU=","keystorePassword":"80c3583b33b84a1d91e5cf33b2421d7c"},"manifest":{"android":{"package":"com.expo.turtle.cli.example"},"bundledAssets":["asset_3a2ba31570920eeb9b1d217cabe58315.ttf","asset_744ce60078c17d86006dd0edabcd59a7.ttf",&qLine truncated
|
||||
Binary file not shown.
@@ -17,7 +17,8 @@ jest.mock('../builders/utils/uploader.ts', () => ({
|
||||
async function performSmokeTest(recording: string) {
|
||||
jest.setTimeout(60 * 60 * 1000);
|
||||
|
||||
const fixtureExists = await fs.pathExists(recording);
|
||||
// @ts-ignore
|
||||
const fixtureExists = await fs.exists(recording);
|
||||
if (fixtureExists) {
|
||||
logger.info('Fixture exists, test will use existing one.');
|
||||
|
||||
|
||||
@@ -136,7 +136,7 @@ function _addEmptyMetrics(metrics: IMetric[]) {
|
||||
acc.add(i.MetricName);
|
||||
}
|
||||
return acc;
|
||||
}, new Set<string>());
|
||||
}, new Set());
|
||||
|
||||
const nonEmptyMetrics = _.omitBy(state.registeredMetrics, ({ addEmpty }) => !addEmpty);
|
||||
const toAdd = _.difference(Object.keys(nonEmptyMetrics), Array.from(seenMetrics));
|
||||
|
||||
@@ -19,10 +19,10 @@ export default function calculateStatistics(metrics: IMetric[]) {
|
||||
});
|
||||
}
|
||||
|
||||
result!.StatisticValues.Maximum = Math.max(result!.StatisticValues.Maximum, i.Value);
|
||||
result!.StatisticValues.Minimum = Math.min(result!.StatisticValues.Minimum, i.Value);
|
||||
result!.StatisticValues.SampleCount += 1;
|
||||
result!.StatisticValues.Sum += i.Value;
|
||||
result.StatisticValues.Maximum = Math.max(result.StatisticValues.Maximum, i.Value);
|
||||
result.StatisticValues.Minimum = Math.min(result.StatisticValues.Minimum, i.Value);
|
||||
result.StatisticValues.SampleCount += 1;
|
||||
result.StatisticValues.Sum += i.Value;
|
||||
return result;
|
||||
}, null);
|
||||
return [reduced];
|
||||
|
||||
@@ -29,11 +29,6 @@ export default (program: any, setCommonCommandOptions: any) => {
|
||||
/^(debug|release)$/i,
|
||||
'release',
|
||||
)
|
||||
.option(
|
||||
'--gradle-args <gradle-args>',
|
||||
'optional arguments passed to gradle, make sure to surround them with double quotes'
|
||||
+ ' (e.g.: --gradle-args "--stacktrace --debug")',
|
||||
)
|
||||
.description(
|
||||
'Build a standalone APK or App Bundle for your project, either signed and ready for submission to'
|
||||
+ ' the Google Play Store or in debug mode.',
|
||||
|
||||
@@ -15,12 +15,7 @@ function setCommonCommandOptions(cmd: any) {
|
||||
.option('-o --output <output-file-path>', 'output file path')
|
||||
.option(
|
||||
'--public-url <url>',
|
||||
'the URL of an externally hosted manifest (for self-hosted apps), only HTTPS URLs are supported unless '
|
||||
+ '--allow-non-https-public-url is also set!',
|
||||
)
|
||||
.option(
|
||||
'--allow-non-https-public-url',
|
||||
'allows non-HTTPS URLs in --public-url; this should only be used when building an unpublished application',
|
||||
'the URL of an externally hosted manifest (for self-hosted apps).',
|
||||
)
|
||||
.option(
|
||||
'--release-channel <channel-name>',
|
||||
|
||||
@@ -5,6 +5,7 @@ import { ExponentTools } from '@expo/xdl';
|
||||
import fs from 'fs-extra';
|
||||
import _which from 'which';
|
||||
|
||||
import ensureAndroidNDKIsPresent from 'turtle/bin/setup/android/ndk';
|
||||
import ensureAndroidSDKIsPresent from 'turtle/bin/setup/android/sdk';
|
||||
import { checkSystem, ensureShellAppIsPresent } from 'turtle/bin/setup/utils/common';
|
||||
import { IToolDefinition } from 'turtle/bin/setup/utils/toolsDetector';
|
||||
@@ -22,8 +23,7 @@ const REQUIRED_TOOLS: IToolDefinition[] = [
|
||||
},
|
||||
{
|
||||
command: 'javac',
|
||||
missingDescription:
|
||||
`Please install JDK 8 - keep in mind that other versions are not supported by Android`,
|
||||
missingDescription: `Please install JDK (version ${JAVA_REQUIRED_VERSION}) - check https://jdk.java.net/`,
|
||||
testFn: async () => {
|
||||
const { status, stdout, stderr } = await ExponentTools.spawnAsyncThrowError(
|
||||
'java',
|
||||
@@ -34,13 +34,11 @@ const REQUIRED_TOOLS: IToolDefinition[] = [
|
||||
return false;
|
||||
}
|
||||
|
||||
const matchResult = stderr.match(/.*version "(.*)"/);
|
||||
const matchResult = stderr.match(/.*version ".*\.(.*)\..*"/);
|
||||
if (matchResult) {
|
||||
const [, currentFullJavaVersion] = matchResult;
|
||||
const javaMajorVersionPosition = currentFullJavaVersion.startsWith('1.') ? 1 : 0;
|
||||
const javaMajorVersion = Number(currentFullJavaVersion.split('.')[javaMajorVersionPosition]);
|
||||
if (javaMajorVersion !== JAVA_REQUIRED_VERSION) {
|
||||
throw new Error(`You're on Java ${currentFullJavaVersion}, please install version ${JAVA_REQUIRED_VERSION}`);
|
||||
const [, currentJavaVersion] = matchResult;
|
||||
if (Number(currentJavaVersion) !== JAVA_REQUIRED_VERSION) {
|
||||
throw new Error(`You're using a wrong Java version, please install version ${JAVA_REQUIRED_VERSION}`);
|
||||
}
|
||||
} else {
|
||||
logger.warn(`Couldn't find Java version number, assuming you're on Java ${JAVA_REQUIRED_VERSION}...`);
|
||||
@@ -68,8 +66,9 @@ export default async function setup(sdkVersion?: string) {
|
||||
async function prepareAndroidEnv() {
|
||||
await fs.ensureDir(config.directories.androidDependenciesDir);
|
||||
const sdkConfig = await ensureAndroidSDKIsPresent();
|
||||
_setEnvVars(sdkConfig.envVars);
|
||||
_alterPath(sdkConfig.path);
|
||||
const ndkConfig = await ensureAndroidNDKIsPresent();
|
||||
_setEnvVars({ ...sdkConfig.envVars, ...ndkConfig.envVars });
|
||||
_alterPath([...sdkConfig.path, ...sdkConfig.path]);
|
||||
}
|
||||
|
||||
function formatShellAppTarballUriPath(sdkMajorVersion: string) {
|
||||
@@ -101,9 +100,7 @@ async function _shellAppPostDownloadAction(sdkVersion: string, workingdir: strin
|
||||
async function _installNodeModules(cwd: string) {
|
||||
l.info(`installing dependencies in ${cwd} directory...`);
|
||||
const command = await _shouldUseYarnOrNpm();
|
||||
// Keep in sync with /Dockerfile
|
||||
// --prod requires --ignore-scripts (otherwise expo-yarn-workspaces errors as missing)
|
||||
await ExponentTools.spawnAsyncThrowError(command, ['install', '--ignore-scripts', '--production'], {
|
||||
await ExponentTools.spawnAsyncThrowError(command, ['install'], {
|
||||
pipeToLogger: true,
|
||||
loggerFields: LOGGER_FIELDS,
|
||||
cwd,
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
|
||||
import decompress from 'decompress';
|
||||
import fs from 'fs-extra';
|
||||
|
||||
import * as utils from 'turtle/bin/setup/utils/common';
|
||||
import download from 'turtle/bin/setup/utils/downloader';
|
||||
import config from 'turtle/config';
|
||||
import logger from 'turtle/logger';
|
||||
|
||||
const ANDROID_NDK_URL = `https://dl.google.com/android/repository/android-ndk-r10e-${os.platform()}-x86_64.zip`;
|
||||
|
||||
const LOGGER_FIELDS = { buildPhase: 'setting up environment' };
|
||||
const l = logger.child(LOGGER_FIELDS);
|
||||
|
||||
export default async function ensureAndroidNDKIsPresent() {
|
||||
const androidNdkDir = path.join(config.directories.androidDependenciesDir, 'ndk');
|
||||
await utils.removeDirectoryUnlessReady(androidNdkDir);
|
||||
if (!(await fs.pathExists(androidNdkDir))) {
|
||||
await fs.ensureDir(androidNdkDir);
|
||||
const androidNdkDownloadPath = utils.formatArtifactDownloadPath(ANDROID_NDK_URL);
|
||||
|
||||
try {
|
||||
l.info('Downloading Android NDK');
|
||||
await fs.ensureDir(config.directories.artifactsDir);
|
||||
await download(ANDROID_NDK_URL, androidNdkDownloadPath);
|
||||
l.info('Decompressing Android NDK');
|
||||
await decompress(androidNdkDownloadPath, androidNdkDir, { strip: 1 });
|
||||
await utils.markDirectoryAsReady(androidNdkDir);
|
||||
l.info('Android NDK installed successfully');
|
||||
} catch (err) {
|
||||
await fs.remove(androidNdkDir);
|
||||
throw err;
|
||||
} finally {
|
||||
await fs.remove(androidNdkDownloadPath);
|
||||
}
|
||||
}
|
||||
return {
|
||||
envVars: _createEnvVars(androidNdkDir),
|
||||
path: _createPaths(androidNdkDir),
|
||||
};
|
||||
}
|
||||
|
||||
function _createEnvVars(androidNdkDir: string) {
|
||||
return {
|
||||
ANDROID_NDK: androidNdkDir,
|
||||
};
|
||||
}
|
||||
|
||||
function _createPaths(androidNdkDir: string) {
|
||||
return [androidNdkDir];
|
||||
}
|
||||
+13
-44
@@ -1,6 +1,3 @@
|
||||
import _url from 'url';
|
||||
|
||||
import { ConfigError, getExpoSDKVersion, ProjectConfig } from '@expo/config';
|
||||
import { ExponentTools } from '@expo/xdl';
|
||||
import _ from 'lodash';
|
||||
import uuid from 'uuid';
|
||||
@@ -57,29 +54,21 @@ export function createBuilderAction({
|
||||
);
|
||||
}
|
||||
|
||||
if (cmd.publicUrl && !cmd.allowNonHttpsPublicUrl) {
|
||||
const parsedPublicUrl = _url.parse(cmd.publicUrl);
|
||||
if (parsedPublicUrl.protocol !== 'https:') {
|
||||
throw new ErrorWithCommandHelp('--public-url is invalid - only HTTPS urls are supported');
|
||||
}
|
||||
}
|
||||
|
||||
const projectAbsoluteDir = ProjectUtils.resolveAbsoluteDir(projectDirArg);
|
||||
const args = {
|
||||
releaseChannel: cmd.releaseChannel || 'default',
|
||||
buildType: cmd.type,
|
||||
buildMode: cmd.mode,
|
||||
username: userData.username || 'anonymous',
|
||||
projectDir: projectAbsoluteDir,
|
||||
projectDir: ProjectUtils.resolveAbsoluteDir(projectDirArg),
|
||||
publicUrl: cmd.publicUrl,
|
||||
};
|
||||
|
||||
const projectConfig = await ProjectUtils.getConfig(projectDirArg, cmd.config);
|
||||
const sdkVersion = getExpoSDKVersionSafely(projectAbsoluteDir, projectConfig);
|
||||
const appJSON = await ProjectUtils.loadAppJSON(projectDirArg, cmd.config);
|
||||
const sdkVersion = _.get(appJSON, 'expo.sdkVersion');
|
||||
await setup(platform, sdkVersion);
|
||||
const credentials = await prepareCredentials(cmd);
|
||||
const rawJob = {
|
||||
...await buildJobObject(cmd, platform, projectConfig, args, credentials, sdkVersion),
|
||||
...await buildJobObject(platform, appJSON, args, credentials),
|
||||
...cmd.buildDir && { fakeUploadDir: ProjectUtils.resolveAbsoluteDir(cmd.buildDir) },
|
||||
...cmd.output && { fakeUploadBuildPath: ProjectUtils.resolveAbsoluteDir(cmd.output) },
|
||||
};
|
||||
@@ -97,53 +86,33 @@ export function createBuilderAction({
|
||||
};
|
||||
}
|
||||
|
||||
function getExpoSDKVersionSafely(projectDir: string, projectConfig: ProjectConfig) {
|
||||
try {
|
||||
return getExpoSDKVersion(projectDir, projectConfig.exp);
|
||||
} catch (err) {
|
||||
if (err instanceof ConfigError) {
|
||||
throw new Error(
|
||||
'Couldn\'t find the `expo` library in your project\'s dependencies.'
|
||||
+ ' Have you run \'yarn install\' or \'npm install\' for your project?',
|
||||
);
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const buildJobObject = async (
|
||||
cmd: any,
|
||||
platform: 'android' | 'ios',
|
||||
projectConfig: ProjectConfig,
|
||||
appJSON: any,
|
||||
{ releaseChannel, buildType, buildMode, username, publicUrl, projectDir }: any,
|
||||
credentials: any,
|
||||
sdkVersion: string,
|
||||
) => {
|
||||
const owner = projectConfig.exp.owner || username;
|
||||
const experienceName = `@${owner}/${projectConfig.exp.slug}`;
|
||||
const job = {
|
||||
config: {
|
||||
...(projectConfig.exp?.[platform]?.config || {}),
|
||||
..._.get(appJSON, `expo.${platform}.config`, {}),
|
||||
buildType,
|
||||
releaseChannel,
|
||||
publicUrl,
|
||||
...(platform === 'android' && cmd.gradleArgs ? { gradleArgs: cmd.gradleArgs.split(' ') } : {}),
|
||||
...(platform === 'android' ? { buildMode } : {}),
|
||||
...(platform === 'android' ? { androidPackage: projectConfig.exp?.android?.package } : {}),
|
||||
...(platform === 'ios' ? { bundleIdentifier: projectConfig.exp?.ios?.bundleIdentifier } : {}),
|
||||
releaseChannel,
|
||||
...(platform === 'ios' ? { bundleIdentifier: _.get(appJSON, 'expo.ios.bundleIdentifier') } : {}),
|
||||
...(platform === 'android' ? { androidPackage: _.get(appJSON, 'expo.android.package') } : {}),
|
||||
publicUrl,
|
||||
},
|
||||
id: uuid.v4(),
|
||||
platform,
|
||||
projectDir,
|
||||
sdkVersion,
|
||||
experienceName,
|
||||
sdkVersion: _.get(appJSON, 'expo.sdkVersion'),
|
||||
experienceName: `@${username}/${_.get(appJSON, 'expo.slug')}`,
|
||||
...(credentials && { credentials }),
|
||||
};
|
||||
const url = getExperienceUrl(job.experienceName, job.config.publicUrl);
|
||||
|
||||
const manifest = await ExponentTools.getManifestAsync(url, {
|
||||
'Exponent-SDK-Version': sdkVersion,
|
||||
'Exponent-SDK-Version': _.get(appJSON, 'expo.sdkVersion'),
|
||||
'Exponent-Platform': platform,
|
||||
'Expo-Release-Channel': releaseChannel,
|
||||
'Accept': 'application/expo+json,application/json',
|
||||
|
||||
+13
-11
@@ -1,18 +1,20 @@
|
||||
import fs from 'fs-extra';
|
||||
import path from 'path';
|
||||
|
||||
import { getConfig as getProjectConfig, setCustomConfigPath } from '@expo/config';
|
||||
import fs from 'fs-extra';
|
||||
|
||||
export async function getConfig(projectDir: string, config: string | null) {
|
||||
projectDir = resolveAbsoluteDir(projectDir);
|
||||
export async function loadAppJSON(projectDirArg: string, config: string | null) {
|
||||
let appJSONPath;
|
||||
if (config) {
|
||||
const pathToConfig = path.resolve(process.cwd(), config);
|
||||
if (!await fs.pathExists(pathToConfig)) {
|
||||
throw new Error(`File at provided config path does not exist: ${pathToConfig}`);
|
||||
}
|
||||
setCustomConfigPath(projectDir, pathToConfig);
|
||||
appJSONPath = resolveAbsoluteDir(config);
|
||||
} else {
|
||||
const projectDir = resolveAbsoluteDir(projectDirArg);
|
||||
appJSONPath = path.join(projectDir, 'app.json');
|
||||
}
|
||||
const appJSONExists = await fs.pathExists(appJSONPath);
|
||||
if (!appJSONExists) {
|
||||
throw new Error(`Couldn't find app.json.`);
|
||||
} else {
|
||||
return require(appJSONPath);
|
||||
}
|
||||
return await getProjectConfig(projectDir, {});
|
||||
}
|
||||
|
||||
export const resolveAbsoluteDir = (dir: string) => {
|
||||
|
||||
+12
-17
@@ -3,6 +3,7 @@ import path from 'path';
|
||||
import { AndroidShellApp, ImageUtils } from '@expo/xdl';
|
||||
import fs from 'fs-extra';
|
||||
import _ from 'lodash';
|
||||
import semver from 'semver';
|
||||
import { ANDROID_BUILD_TYPES } from 'turtle/constants';
|
||||
import uuidv4 from 'uuid/v4';
|
||||
|
||||
@@ -10,7 +11,7 @@ import getOrCreateCredentials from 'turtle/builders/utils/android/credentials';
|
||||
import { formatShellAppDirectory } from 'turtle/builders/utils/android/workingdir';
|
||||
import * as commonUtils from 'turtle/builders/utils/common';
|
||||
import * as imageHelpers from 'turtle/builders/utils/image';
|
||||
import { resolveExplicitOptIn, resolveNativeModules } from 'turtle/builders/utils/unimodules';
|
||||
import { resolveExplicitOptIn } from 'turtle/builders/utils/unimodules';
|
||||
import { uploadBuildToS3 } from 'turtle/builders/utils/uploader';
|
||||
import { ensureCanBuildSdkVersion } from 'turtle/builders/utils/version';
|
||||
import config from 'turtle/config';
|
||||
@@ -26,7 +27,7 @@ export default async function buildAndroid(jobData: IJob): Promise<IJobResult> {
|
||||
const s3FileExtension = jobData.config.buildType === ANDROID_BUILD_TYPES.APP_BUNDLE ? 'aab' : 'apk';
|
||||
const s3Filename = `${jobData.experienceName}-${randomHex}-signed.${s3FileExtension}`;
|
||||
const s3FileKey = `android/${s3Filename}`;
|
||||
const fakeUploadFilename = s3Filename.replace('/', '__');
|
||||
const fakeUploadFilename = s3Filename.replace('/', '\\');
|
||||
|
||||
const artifactUrl = await uploadBuildToS3({
|
||||
uploadPath: outputFilePath,
|
||||
@@ -34,8 +35,8 @@ export default async function buildAndroid(jobData: IJob): Promise<IJobResult> {
|
||||
...config.builder.fakeUpload && {
|
||||
fakeUploadBuildPath:
|
||||
jobData.fakeUploadBuildPath
|
||||
? jobData.fakeUploadBuildPath
|
||||
: path.join(jobData.fakeUploadDir || config.directories.fakeUploadDir, fakeUploadFilename),
|
||||
? jobData.fakeUploadBuildPath
|
||||
: path.join(jobData.fakeUploadDir || config.directories.fakeUploadDir, fakeUploadFilename),
|
||||
},
|
||||
});
|
||||
|
||||
@@ -72,20 +73,15 @@ async function runShellAppBuilder(
|
||||
const sdkVersion = _.get(manifest, 'sdkVersion', sdkVersionFromJob);
|
||||
const workingDir = formatShellAppDirectory({ sdkVersion });
|
||||
|
||||
// Default behaviour:
|
||||
// - load all modules except [expo-branch]
|
||||
// - load expo-branch only if present in package.json dependencies
|
||||
// (2019-07-31) We are explicitly choosing to disable this option until we have more
|
||||
// infrastructure/tooling built around optional modules and OTA updates, as right now it's
|
||||
// very easy for developers to break apps in production with optional modules.
|
||||
//
|
||||
// Behaviour with "enableDangerousExperimentalLeanBuilds" flag enabled
|
||||
// - add unimodules from `manifest.dependencies` (project package.json dependecies)
|
||||
// - add unimodules from react-native-unimodules package.json
|
||||
// - add unimodules from expo package package.json
|
||||
// - add recusively all dependecies of already added unimodules
|
||||
// to enable full resolver switch resolveExplicitOptIn to resolveNativeModules
|
||||
logger.info({ buildPhase: 'resolve native modules' }, 'Resolving universal modules dependencies');
|
||||
const packageJsonDependecies = _.get(manifest, 'dependencies');
|
||||
const enabledModules = _.get(manifest, 'android.enableDangerousExperimentalLeanBuilds')
|
||||
? await resolveNativeModules(workingDir, packageJsonDependecies)
|
||||
: await resolveExplicitOptIn(workingDir, packageJsonDependecies);
|
||||
const enabledModules = semver.satisfies(sdkVersion, '>= 33.0.0')
|
||||
? await resolveExplicitOptIn(workingDir, _.get(manifest, 'dependencies'))
|
||||
: null;
|
||||
|
||||
try {
|
||||
await AndroidShellApp.createAndroidShellAppAsync({
|
||||
@@ -103,7 +99,6 @@ async function runShellAppBuilder(
|
||||
modules: enabledModules,
|
||||
buildType: jobData.config.buildType,
|
||||
buildMode: jobData.config.buildMode,
|
||||
gradleArgs: jobData.config.gradleArgs,
|
||||
});
|
||||
} catch (err) {
|
||||
commonUtils.logErrorOnce(err);
|
||||
|
||||
@@ -131,7 +131,7 @@ export function createBuilderContext(job: IJob): IContext {
|
||||
const s3FileExtension = buildType === IOS_BUILD_TYPES.SIMULATOR ? 'tar.gz' : 'ipa';
|
||||
const s3Filename = `${job.experienceName}-${appUUID}-${buildType}.${s3FileExtension}`;
|
||||
if (config.builder.fakeUpload) {
|
||||
const fakeUploadFilename = s3Filename.replace('/', '__');
|
||||
const fakeUploadFilename = s3Filename.replace('/', '\\');
|
||||
context.fakeUploadBuildPath = job.fakeUploadBuildPath
|
||||
? job.fakeUploadBuildPath
|
||||
: join(job.fakeUploadDir || config.directories.fakeUploadDir, fakeUploadFilename);
|
||||
|
||||
+3
-13
@@ -1,4 +1,3 @@
|
||||
import fs from 'fs';
|
||||
import os from 'os';
|
||||
import path from 'path';
|
||||
|
||||
@@ -45,17 +44,8 @@ export default {
|
||||
intervalMs: env('DATADOG_INTERVAL_MS', 5 * 60 * 1000),
|
||||
},
|
||||
redis: {
|
||||
main: {
|
||||
url: env('REDIS_URL'),
|
||||
caCertificate: envTransform(
|
||||
'REDIS_CA_CERTIFICATE',
|
||||
null,
|
||||
(caCertificate: string) => caCertificate && fs.readFileSync(caCertificate),
|
||||
),
|
||||
},
|
||||
turtle: {
|
||||
url: env('REDIS_CONFIG_URL'),
|
||||
},
|
||||
url: env('REDIS_URL'),
|
||||
configUrl: env('REDIS_CONFIG_URL'),
|
||||
},
|
||||
logger: {
|
||||
level: env('LOGGER_LEVEL', 'info'),
|
||||
@@ -91,7 +81,7 @@ export default {
|
||||
androidDependenciesDir: env(
|
||||
'TURTLE_ANDROID_DEPENDENCIES_DIR',
|
||||
path.join(os.homedir(), '.turtle/androidDependencies'),
|
||||
),
|
||||
),
|
||||
tempS3LogsDir: env('TURTLE_TEMP_S3_LOGS_DIR', '/tmp/logs'),
|
||||
fakeUploadDir: envOptional('TURTLE_FAKE_UPLOAD_DIR'),
|
||||
temporaryFilesRoot: env(
|
||||
|
||||
@@ -15,7 +15,6 @@ export interface IJob {
|
||||
// android
|
||||
androidPackage?: string;
|
||||
buildMode?: ANDROID_BUILD_MODES;
|
||||
gradleArgs?: string[];
|
||||
};
|
||||
credentials: {
|
||||
// android
|
||||
|
||||
+7
-9
@@ -10,7 +10,7 @@ import logger from 'turtle/logger';
|
||||
import * as buildDurationMetric from 'turtle/metrics/buildDuration';
|
||||
import * as buildStatusMetric from 'turtle/metrics/buildStatus';
|
||||
import { checkShouldExit, setCurrentJobId, turtleVersion } from 'turtle/turtleContext';
|
||||
import { getPriorities, labelConfiguration, TurtleMode } from 'turtle/utils/priorities';
|
||||
import { getPriorities } from 'turtle/utils/priorities';
|
||||
import * as redis from 'turtle/utils/redis';
|
||||
import { sanitizeJob } from 'turtle/validator';
|
||||
|
||||
@@ -22,8 +22,8 @@ function _maybeExit() {
|
||||
}
|
||||
|
||||
export async function doJob() {
|
||||
const { job, turtleMode } = await getJob();
|
||||
await processJob(job, turtleMode);
|
||||
const jobData = await getJob();
|
||||
await processJob(jobData);
|
||||
_maybeExit();
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ export async function getJob() {
|
||||
try {
|
||||
let job = null;
|
||||
const priorities = await getPriorities();
|
||||
const turtleMode = labelConfiguration(priorities);
|
||||
for (const priority of priorities) {
|
||||
job = await sqs.receiveMessage(priority);
|
||||
_maybeExit();
|
||||
@@ -45,7 +44,7 @@ export async function getJob() {
|
||||
}
|
||||
_maybeExit();
|
||||
if (job !== null) {
|
||||
return { job, turtleMode };
|
||||
return job;
|
||||
}
|
||||
} catch (err) {
|
||||
logger.error({ err }, 'Error at receiving messages');
|
||||
@@ -53,7 +52,7 @@ export async function getJob() {
|
||||
}
|
||||
}
|
||||
|
||||
async function processJob(jobData: any, turtleMode: TurtleMode) {
|
||||
async function processJob(jobData: any) {
|
||||
const receiptHandle = jobData.ReceiptHandle;
|
||||
const { priority } = jobData;
|
||||
|
||||
@@ -93,7 +92,7 @@ async function processJob(jobData: any, turtleMode: TurtleMode) {
|
||||
let buildFailed = false;
|
||||
const buildType = _.get(job, 'config.buildType', 'default');
|
||||
try {
|
||||
const status = await build(job, turtleMode);
|
||||
const status = await build(job);
|
||||
buildStatusMetric.add(buildType, priority, status);
|
||||
buildFailed = !status;
|
||||
} catch (err) {
|
||||
@@ -138,7 +137,7 @@ function failAfterMaxJobTime(priority: string, receiptHandle: string, job: any)
|
||||
}, config.builder.maxJobTimeMs);
|
||||
}
|
||||
|
||||
async function build(job: any, turtleMode: TurtleMode) {
|
||||
async function build(job: any) {
|
||||
const startTimestamp = Date.now();
|
||||
const s3Url = await logger.initForJob(job);
|
||||
const calculateBuildDuration = () => Math.ceil((Date.now() - startTimestamp) / 1000);
|
||||
@@ -147,7 +146,6 @@ async function build(job: any, turtleMode: TurtleMode) {
|
||||
await sqs.sendMessage(job.id, BUILD.JOB_STATES.IN_PROGRESS, {
|
||||
logUrl: s3Url,
|
||||
logFormat: 'json',
|
||||
turtleMode,
|
||||
});
|
||||
const result = await (builders as any)[job.platform](job);
|
||||
const buildDuration = calculateBuildDuration();
|
||||
|
||||
@@ -15,7 +15,6 @@ export default baseJobSchema.concat(
|
||||
config: Joi.object().keys({
|
||||
buildMode: Joi.string().valid(Object.values(ANDROID_BUILD_MODES)).default(ANDROID_BUILD_MODES.RELEASE),
|
||||
buildType: Joi.string().valid(Object.values(ANDROID_BUILD_TYPES)).default(ANDROID_BUILD_TYPES.APK),
|
||||
gradleArgs: Joi.array().items(Joi.string()),
|
||||
}),
|
||||
}),
|
||||
);
|
||||
@@ -5,11 +5,11 @@ import take from 'lodash/take';
|
||||
import logger from 'turtle/logger';
|
||||
import { sendMetric } from 'turtle/metrics/datadog';
|
||||
import { getReplicaCount } from 'turtle/utils/metadata';
|
||||
import { getLabeledConfiguration, TurtleMode } from 'turtle/utils/priorities';
|
||||
import { getLabeledConfiguration, TurtleModeLabels } from 'turtle/utils/priorities';
|
||||
|
||||
const createMetricName = () => `turtle.replicaCount`;
|
||||
const createModeMetricName = (mode: TurtleMode) => `${createMetricName()}.${mode}`;
|
||||
const createModeTag = (mode: TurtleMode) => `mode:${mode}`;
|
||||
const createModeMetricName = (mode: TurtleModeLabels) => `${createMetricName()}.${mode}`;
|
||||
const createModeTag = (mode: TurtleModeLabels) => `mode:${mode}`;
|
||||
|
||||
export default async function sendConfigToDatadog() {
|
||||
let configuration;
|
||||
@@ -30,28 +30,28 @@ export default async function sendConfigToDatadog() {
|
||||
|
||||
const metricName = createMetricName();
|
||||
|
||||
const normalReplicaCount = replicaCounts[TurtleMode.Normal] || 0;
|
||||
const highReplicaCount = replicaCounts[TurtleMode.High] || 0;
|
||||
const highOnlyReplicaCount = replicaCounts[TurtleMode.HighOnly] || 0;
|
||||
const normalReplicaCount = replicaCounts[TurtleModeLabels.Normal] || 0;
|
||||
const highReplicaCount = replicaCounts[TurtleModeLabels.High] || 0;
|
||||
const highOnlyReplicaCount = replicaCounts[TurtleModeLabels.HighOnly] || 0;
|
||||
|
||||
const normalTag = createModeTag(TurtleMode.Normal);
|
||||
const normalMetricName = createModeMetricName(TurtleMode.Normal);
|
||||
const normalTag = createModeTag(TurtleModeLabels.Normal);
|
||||
const normalMetricName = createModeMetricName(TurtleModeLabels.Normal);
|
||||
logger.debug(
|
||||
`Sending ${metricName}=${normalReplicaCount} (${normalTag}), ${normalMetricName}=${normalReplicaCount} to Datadog`,
|
||||
);
|
||||
await sendMetric(metricName, normalReplicaCount, [normalTag]);
|
||||
await sendMetric(normalMetricName, normalReplicaCount);
|
||||
|
||||
const highTag = createModeTag(TurtleMode.High);
|
||||
const highMetricName = createModeMetricName(TurtleMode.High);
|
||||
const highTag = createModeTag(TurtleModeLabels.High);
|
||||
const highMetricName = createModeMetricName(TurtleModeLabels.High);
|
||||
logger.debug(
|
||||
`Sending ${metricName}=${highReplicaCount} (${highTag}), ${highMetricName}=${highReplicaCount} to Datadog`,
|
||||
);
|
||||
await sendMetric(metricName, highReplicaCount, [highTag]);
|
||||
await sendMetric(highMetricName, highReplicaCount);
|
||||
|
||||
const highOnlyTag = createModeTag(TurtleMode.HighOnly);
|
||||
const highOnlyMetricName = createModeMetricName(TurtleMode.HighOnly);
|
||||
const highOnlyTag = createModeTag(TurtleModeLabels.HighOnly);
|
||||
const highOnlyMetricName = createModeMetricName(TurtleModeLabels.HighOnly);
|
||||
logger.debug(
|
||||
`Sending ${metricName}=${highOnlyReplicaCount} (${highOnlyTag}),`
|
||||
+ ` ${highOnlyMetricName}=${highOnlyReplicaCount} to Datadog`,
|
||||
|
||||
Vendored
+1
@@ -4,6 +4,7 @@ declare module 'bunyan-sentry-stream';
|
||||
declare module 'bunyan-debug-stream';
|
||||
declare module 'copy';
|
||||
declare module 'dogapi';
|
||||
declare module 'ioredis';
|
||||
declare module 'is-semver';
|
||||
declare module 'request-progress';
|
||||
declare module '@expo/xdl';
|
||||
+10
-12
@@ -9,7 +9,7 @@ import { getRedisClient, RedisClient } from 'turtle/utils/redis';
|
||||
export const NORMAL = 'normalPriority';
|
||||
export const HIGH = 'highPriority';
|
||||
|
||||
export enum TurtleMode {
|
||||
export enum TurtleModeLabels {
|
||||
Normal = 'normal',
|
||||
High = 'high',
|
||||
HighOnly = 'highOnly',
|
||||
@@ -100,15 +100,13 @@ async function getConfiguration(currentRedisClient: any) {
|
||||
|
||||
export async function getLabeledConfiguration(currentRedisClient?: any) {
|
||||
const configuration = await getConfiguration(currentRedisClient);
|
||||
return configuration.map((i: string[]) => labelConfiguration(i));
|
||||
}
|
||||
|
||||
export function labelConfiguration(configuration: string[]): TurtleMode {
|
||||
if (isEqual(configuration, NORMAL_CONFIGURATION)) {
|
||||
return TurtleMode.Normal;
|
||||
} else if (isEqual(configuration, HIGH_CONFIGURATION)) {
|
||||
return TurtleMode.High;
|
||||
} else {
|
||||
return TurtleMode.HighOnly;
|
||||
}
|
||||
return configuration.map((i: string[]) => {
|
||||
if (isEqual(i, NORMAL_CONFIGURATION)) {
|
||||
return TurtleModeLabels.Normal;
|
||||
} else if (isEqual(i, HIGH_CONFIGURATION)) {
|
||||
return TurtleModeLabels.High;
|
||||
} else {
|
||||
return TurtleModeLabels.HighOnly;
|
||||
}
|
||||
});
|
||||
}
|
||||
+6
-15
@@ -12,27 +12,18 @@ export enum RedisClient {
|
||||
Configuration = 'REDIS_CLIENT_CONFIGURATION',
|
||||
}
|
||||
|
||||
interface IClientConfig {
|
||||
[key: string]: {
|
||||
url: string;
|
||||
caCertificate?: string;
|
||||
};
|
||||
}
|
||||
interface IClientConfig { [key: string]: string; }
|
||||
|
||||
const clientConfigs: IClientConfig = {
|
||||
[RedisClient.Subscriber]: config.redis.main,
|
||||
[RedisClient.Default]: config.redis.main,
|
||||
[RedisClient.Configuration]: config.redis.turtle,
|
||||
const clientToUrl: IClientConfig = {
|
||||
[RedisClient.Subscriber]: config.redis.url,
|
||||
[RedisClient.Default]: config.redis.url,
|
||||
[RedisClient.Configuration]: config.redis.configUrl,
|
||||
};
|
||||
|
||||
export function connect(timeoutMs: number, type: string): Promise<any> {
|
||||
return new Promise((resolve, reject) => {
|
||||
const { url, caCertificate } = clientConfigs[type];
|
||||
const redisClient = new Redis(url, {
|
||||
const redisClient = new Redis(clientToUrl[type], {
|
||||
maxRetriesPerRequest: 2,
|
||||
...caCertificate && {
|
||||
tls: { ca: caCertificate },
|
||||
},
|
||||
});
|
||||
const timer = setTimeout(() => reject(new Error('Timeout at connecting to Redis')), timeoutMs);
|
||||
redisClient.on('ready', () => {
|
||||
|
||||
@@ -38,9 +38,9 @@ async function setTurtleVersion(version: string) {
|
||||
function resolveWWWEndpoint() {
|
||||
const currentEnv = config.deploymentEnv;
|
||||
if (currentEnv === 'production') {
|
||||
return 'https://exp.host';
|
||||
return 'https://expo.io';
|
||||
} else if (currentEnv === 'staging') {
|
||||
return 'https://staging.exp.host';
|
||||
return 'https://staging.expo.io';
|
||||
} else {
|
||||
return 'http://127.0.0.1:3000';
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
#! /usr/bin/env bash
|
||||
# This file was generated by nix-binstubs
|
||||
exec nix run -f "$(dirname "$0")/../../../nix" nodejs-12_x --command node "$@"
|
||||
exec nix run -f "$(dirname "$0")/../../../nix" nodejs-8_x --command node "$@"
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
#! /usr/bin/env bash
|
||||
# This file was generated by nix-binstubs
|
||||
exec nix run -f "$(dirname "$0")/../../../nix" nodejs-12_x --command npm "$@"
|
||||
exec nix run -f "$(dirname "$0")/../../../nix" nodejs-8_x --command npm "$@"
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
#! /usr/bin/env bash
|
||||
# This file was generated by nix-binstubs
|
||||
exec nix run -f "$(dirname "$0")/../../../nix" nodejs-12_x --command npx "$@"
|
||||
exec nix run -f "$(dirname "$0")/../../../nix" nodejs-8_x --command npx "$@"
|
||||
Reference in new issue
Block a user