-
Notifications
You must be signed in to change notification settings - Fork 1
/
local-hide-config-env.sh
executable file
·63 lines (54 loc) · 2.77 KB
/
local-hide-config-env.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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env bash
source .env
ROOT_FOLDER=$(dirname $0)
PROJECT_NAME="ReactNativeStart"
#Config Firebase Android config files
cp /dev/null $ROOT_FOLDER/android/app/google-services.json
#Config Firebase iOS config files
cp /dev/null $ROOT_FOLDER/ios/GoogleService-Info.plist
#Config Google Maps API
GOOGLE_CONFIG_IOS_FILE=$ROOT_FOLDER/ios/$PROJECT_NAME/AppDelegate.m
sed -i '' -e "s/$GOOGLE_MAPS_KEY/__GOOGLE_MAPS_KEY__/" $GOOGLE_CONFIG_IOS_FILE
echo '---------------- GOOGLE MAPS API - iOS'
echo "Google Maps API: File content: $GOOGLE_CONFIG_IOS_FILE"
#cat $GOOGLE_CONFIG_IOS_FILE
echo '----------------'
GOOGLE_CONFIG_ANDROID_FILE=$ROOT_FOLDER/android/app/src/main/AndroidManifest.xml
sed -i '' -e "s/$GOOGLE_MAPS_KEY/__GOOGLE_MAPS_KEY__/" $GOOGLE_CONFIG_ANDROID_FILE
echo '---------------- GOOGLE MAPS API - Android'
echo "Google Maps API: File content: $GOOGLE_CONFIG_ANDROID_FILE"
#cat $GOOGLE_CONFIG_ANDROID_FILE
echo '----------------'
#Config Codepush
CODEPUSH_IOS_FILE=$ROOT_FOLDER/ios/$PROJECT_NAME/Info.plist
sed -i '' -e "s/$CODEPUSH_KEY/__CODEPUSH_KEY__/" $CODEPUSH_IOS_FILE
echo "Codepush Key: File content: $CODEPUSH_IOS_FILE"
#cat $CODEPUSH_IOS_FILE
echo '----------------'
CODEPUSH_ANDROID_FILE=$ROOT_FOLDER/android/app/src/main/res/values/strings.xml
sed -i '' -e "s/$CODEPUSH_KEY/__CODEPUSH_KEY__/" $CODEPUSH_ANDROID_FILE
echo "Codepush Key: File content: $CODEPUSH_ANDROID_FILE"
#cat $CODEPUSH_ANDROID_FILE
echo '----------------'
#Config Dynatrace
DYNATRACE_IOS_FILE=$ROOT_FOLDER/ios/$PROJECT_NAME/Info.plist
sed -i '' -e "s/$DYNATRACE_APP_ID/__DYNATRACE_APP_ID__/" $DYNATRACE_IOS_FILE
sed -i '' -e "s,$DYNATRACE_IOS_ENVIRONMENT,__DYNATRACE_IOS_ENVIRONMENT__,g" $DYNATRACE_IOS_FILE
sed -i '' -e "s,$DYNATRACE_IOS_CLUSTER_URL,__DYNATRACE_IOS_CLUSTER_URL__,g" $DYNATRACE_IOS_FILE
echo "DYNATRACE Key: File content: $DYNATRACE_IOS_FILE"
#cat $DYNATRACE_IOS_FILE
echo '----------------'
DYNATRACE_ANDROID_FILE=$ROOT_FOLDER/android/app/build.gradle
sed -i '' -e "s/$DYNATRACE_APP_ID/__DYNATRACE_APP_ID__/" $DYNATRACE_ANDROID_FILE
sed -i '' -e "s,$DYNATRACE_ANDROID_BEACON_URL,__DYNATRACE_ANDROID_BEACON_URL__,g" $DYNATRACE_ANDROID_FILE
echo "DYNATRACE Key: File content: $DYNATRACE_ANDROID_FILE"
#cat $DYNATRACE_ANDROID_FILE
echo '----------------'
DYNATRACE_PLUGIN_FILE=$ROOT_FOLDER/dynatrace.config
sed -i '' -e "s/$DYNATRACE_APP_ID/__DYNATRACE_APP_ID__/g" $DYNATRACE_PLUGIN_FILE
sed -i '' -e "s,$DYNATRACE_ANDROID_BEACON_URL,__DYNATRACE_ANDROID_BEACON_URL__,g" $DYNATRACE_PLUGIN_FILE
sed -i '' -e "s,$DYNATRACE_IOS_ENVIRONMENT,__DYNATRACE_IOS_ENVIRONMENT__,g" $DYNATRACE_PLUGIN_FILE
sed -i '' -e "s,$DYNATRACE_IOS_CLUSTER_URL,__DYNATRACE_IOS_CLUSTER_URL__,g" $DYNATRACE_PLUGIN_FILE
echo "DYNATRACE Config: File content: $DYNATRACE_PLUGIN_FILE"
#cat $DYNATRACE_PLUGIN_FILE
echo '----------------'