Properly fix license issue in CircleCI (#362)
Summary: Apparently this seems to be the only way to make build work, with the updated licenses. It also follows the same strategy as Travis. I am using double pipe in `sdkmanager` command execution, to avoid breaking the build, because `sdkmanager` returns exit code 141 in case it meets the requirements requested. (e.g.: `yes | sdkmanager --licenses` returns 141, which in turn breaks the build due to `set -eo pipefail` Bash flags, that CircleCI is using in order to execute any scripts) For the record, I tried the following solutions, that did not work: * Add accepted license SHA in Android SDK licenses folder. * Accept all licenses prior to running the other jobs (with a separate job, working as a dependency to the rest of the Workflow jobs) (`yes | sdkmanager --licenses`) * Accept all licenses prior to executing any Gradle command (without a separate job) (`yes | sdkmanager --licenses`) Pull Request resolved: https://github.com/facebook/flipper/pull/362 Differential Revision: D13817430 Pulled By: passy fbshipit-source-id: d8c95fc5b9202306dd50ea103b6e90142e73ef61
This commit is contained in:
committed by
Facebook Github Bot
parent
fb2edd3ad3
commit
b8dbbb0313
@@ -9,17 +9,6 @@ executors:
|
|||||||
TERM: 'dumb'
|
TERM: 'dumb'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
add_accepted_android_sdk_license:
|
|
||||||
executor: default-executor
|
|
||||||
docker:
|
|
||||||
- image: circleci/android:api-28-ndk-r17b
|
|
||||||
steps:
|
|
||||||
- run:
|
|
||||||
name: Add accepted Android SDK license
|
|
||||||
command: |
|
|
||||||
mkdir -p "$ANDROID_HOME/licenses/"
|
|
||||||
echo > "$ANDROID_HOME/licenses/android-sdk-license"
|
|
||||||
echo -n 24333f8a63b6825ea9c5514f83c2829b004d1fee > "$ANDROID_HOME/licenses/android-sdk-license"
|
|
||||||
snapshot:
|
snapshot:
|
||||||
executor: default-executor
|
executor: default-executor
|
||||||
docker:
|
docker:
|
||||||
@@ -28,7 +17,9 @@ jobs:
|
|||||||
- checkout
|
- checkout
|
||||||
- run:
|
- run:
|
||||||
name: build and deploy
|
name: build and deploy
|
||||||
command: ./gradlew :android:assembleRelease && scripts/publish-android-snapshot.sh
|
command: |
|
||||||
|
yes | sdkmanager "platforms;android-27" || true
|
||||||
|
./gradlew :android:assembleRelease && scripts/publish-android-snapshot.sh
|
||||||
|
|
||||||
release:
|
release:
|
||||||
executor: default-executor
|
executor: default-executor
|
||||||
@@ -38,13 +29,14 @@ jobs:
|
|||||||
- checkout
|
- checkout
|
||||||
- run:
|
- run:
|
||||||
name: build and deploy
|
name: build and deploy
|
||||||
command: ./gradlew :android:assembleRelease && scripts/publish-android-release.sh
|
command: |
|
||||||
|
yes | sdkmanager "platforms;android-27" || true
|
||||||
|
./gradlew :android:assembleRelease && scripts/publish-android-release.sh
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
version: 2
|
version: 2
|
||||||
build-and-deploy:
|
build-and-deploy:
|
||||||
jobs:
|
jobs:
|
||||||
- add_accepted_android_sdk_license
|
|
||||||
- snapshot:
|
- snapshot:
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
|
|||||||
Reference in New Issue
Block a user