-
Notifications
You must be signed in to change notification settings - Fork 33
/
appcenter-pre-build.sh
26 lines (23 loc) · 1.08 KB
/
appcenter-pre-build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
echo "Injecting secrets..."
echo "Updating Google JSON"
echo $GOOGLE_SERVICES_JSON | base64 --decode > "$APPCENTER_SOURCE_DIRECTORY/android/app/google-services.json"
echo "Updating Google plist"
echo $GOOGLE_SERVICES_PLIST | base64 --decode > "$APPCENTER_SOURCE_DIRECTORY/ios/dryvofront/GoogleService-Info.plist"
echo "Updating android secret"
echo $ANDROID_SECRET | base64 --decode > "$APPCENTER_SOURCE_DIRECTORY/android/app/src/main/assets/appcenter-config.json"
echo "Updating iOS secret"
echo $IOS_SECRET | base64 --decode > "$APPCENTER_SOURCE_DIRECTORY/ios/dryvofront/AppCenter-Config.plist"
echo "Finished injecting secrets."
# echo "replacing codepush secrets..."
# sed -i '' 's/<string>CODE_HERE/<string>$CODEPUSH_SECRET/' ios/dryvofront/Info.plist
# sed -i '' 's/>CODE_HERE/>$CODEPUSH_SECRET/' android/app/src/main/res/values/strings.xml
# echo "Finished replacing codepush secrets."
echo "Creating env..."
if [ $ENV_FILE = "production" ]; then
cp .env.production .env
else
cp .env.staging .env
fi
sed -i '' "s/THE_SECRET/$CODEPUSH_SECRET/" .env
echo "env created with contents:"
cat .env