From cda67427fae53281cf85c9560008c5d3d97d528e Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Wed, 24 Oct 2018 13:37:22 -0300 Subject: [PATCH] Check $FABRIC_KEY availability in CircleCI (#506) * Check $FABRIC_KEY in CircleCI * Remove config scripts --- .circleci/config.yml | 8 +++++--- .gitignore | 1 - README.md | 5 ----- android/app/fabric.properties | 2 ++ scripts/fabric-android.sh | 19 ------------------- scripts/fabric-ios.sh | 19 ------------------- 6 files changed, 7 insertions(+), 47 deletions(-) create mode 100644 android/app/fabric.properties delete mode 100755 scripts/fabric-android.sh delete mode 100755 scripts/fabric-ios.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 443e08e8b..a408c91cd 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -132,9 +132,11 @@ jobs: echo -e "VERSIONCODE=$CIRCLE_BUILD_NUM" >> ./gradle.properties - echo -e "" > ./app/fabric.properties - echo -e "apiKey=$FABRIC_KEY" >> ./app/fabric.properties - echo -e "apiSecret=$FABRIC_SECRET" >> ./app/fabric.properties + if [[ $FABRIC_KEY ]]; then + echo -e "" > ./app/fabric.properties + echo -e "apiKey=$FABRIC_KEY" >> ./app/fabric.properties + echo -e "apiSecret=$FABRIC_SECRET" >> ./app/fabric.properties + fi - run: name: Install Android Depedencies diff --git a/.gitignore b/.gitignore index 1a68faf71..3762b2466 100644 --- a/.gitignore +++ b/.gitignore @@ -28,7 +28,6 @@ build/ .idea .gradle local.properties -fabric.properties *.iml # node.js diff --git a/README.md b/README.md index c672b50d3..6d7d4ab24 100644 --- a/README.md +++ b/README.md @@ -28,11 +28,6 @@ Follow the [React Native Getting Started Guide](https://facebook.github.io/react $ npm install -g react-native-cli $ npm install ``` -- Configuration - ```bash - $ npm run fabric-ios --key="YOUR_API_KEY" --secret="YOUR_API_SECRET" - $ npm run fabric-android --key="YOUR_API_KEY" --secret="YOUR_API_SECRET" - ``` - Run application ```bash diff --git a/android/app/fabric.properties b/android/app/fabric.properties new file mode 100644 index 000000000..88c8f1d4a --- /dev/null +++ b/android/app/fabric.properties @@ -0,0 +1,2 @@ +apiKey=ef3f46fdf18479fd3e1b9b78d0ec73751a255e14 +apiSecret=e8e3d04c28bc04acd009484da5bb9d1440c4f53851564e9f95c3225ec8b0bc76 \ No newline at end of file diff --git a/scripts/fabric-android.sh b/scripts/fabric-android.sh deleted file mode 100755 index a4d23d12d..000000000 --- a/scripts/fabric-android.sh +++ /dev/null @@ -1,19 +0,0 @@ -# #!/bin/bash -while [ "$#" -gt 0 ]; do - case "$1" in - --key=*) key="${1#*=}"; shift 1;; - --secret=*) secret="${1#*=}"; shift 1;; - --key|--secret) echo "$1 requires an argument" >&2; exit 1;; - - -*) echo "unknown option: $1" >&2; exit 1;; - esac -done - -if [[ -z ${key} || -z ${secret} ]] - then - echo 'Usage: yarn fabric-android --key="YOUR_API_KEY" --secret="YOUR_API_SECRET"' - exit 1 -fi - -echo "apiKey=${key}" > ./android/app/fabric.properties -echo "apiSecret=${secret}" >> ./android/app/fabric.properties \ No newline at end of file diff --git a/scripts/fabric-ios.sh b/scripts/fabric-ios.sh deleted file mode 100755 index 4a3566f15..000000000 --- a/scripts/fabric-ios.sh +++ /dev/null @@ -1,19 +0,0 @@ -# #!/bin/bash -while [ "$#" -gt 0 ]; do - case "$1" in - --key=*) key="${1#*=}"; shift 1;; - --secret=*) secret="${1#*=}"; shift 1;; - --key|--secret) echo "$1 requires an argument" >&2; exit 1;; - - -*) echo "unknown option: $1" >&2; exit 1;; - esac -done - -if [[ -z ${key} || -z ${secret} ]] - then - echo 'Usage: yarn fabric-ios --key="YOUR_API_KEY" --secret="YOUR_API_SECRET"' - exit 1 -fi - -/usr/libexec/PlistBuddy -c "Set Fabric:APIKey ${key}" ./ios/RocketChatRN/Info.plist -echo "./Fabric.framework/run ${key} ${secret}" > ./ios/RocketChatRN/Fabric.sh \ No newline at end of file