Revision control

1
#!/usr/bin/env bash
2
3
bundle install
4
bundle exec danger --fail-on-errors=false
5
6
#
7
# Add our Adjust keys to the build depending on the scheme. We use the sandbox for beta so
8
# that we have some insight in beta usage.
9
#
10
11
if [ "$BUDDYBUILD_SCHEME" == FirefoxBeta ]; then
12
echo "Setting Adjust environment to SANDBOX for $BUDDYBUILD_SCHEME"
13
/usr/libexec/PlistBuddy -c "Set AdjustAppToken $ADJUST_KEY_BETA" "Client/Info.plist"
14
/usr/libexec/PlistBuddy -c "Set AdjustEnvironment production" "Client/Info.plist"
15
elif [ "$BUDDYBUILD_SCHEME" == Firefox ]; then
16
echo "Setting Adjust environment to PRODUCTION for $BUDDYBUILD_SCHEME"
17
/usr/libexec/PlistBuddy -c "Set AdjustAppToken $ADJUST_KEY_PRODUCTION" "Client/Info.plist"
18
/usr/libexec/PlistBuddy -c "Set AdjustEnvironment production" "Client/Info.plist"
19
fi
20
21
#
22
# Leanplum is included only for the Firefox and FirefoxBeta builds.
23
#
24
25
if [ "$BUDDYBUILD_SCHEME" = "Firefox" ] || [ "$BUDDYBUILD_SCHEME" = "FirefoxBeta" ]; then
26
echo "Setting Leanplum environment to PRODUCTION for $BUDDYBUILD_SCHEME"
27
/usr/libexec/PlistBuddy -c "Set LeanplumAppId $LEANPLUM_APP_ID" "Client/Info.plist"
28
/usr/libexec/PlistBuddy -c "Set LeanplumProductionKey $LEANPLUM_KEY_PRODUCTION" "Client/Info.plist"
29
/usr/libexec/PlistBuddy -c "Set LeanplumDevelopmentKey $LEANPLUM_KEY_DEVELOPMENT" "Client/Info.plist"
30
fi
31
32
echo "Setting up Pocket Stories API Key"
33
if [ "$BUDDYBUILD_SCHEME" == Firefox ]; then
34
/usr/libexec/PlistBuddy -c "Set PocketEnvironmentAPIKey $POCKET_PRODUCTION_API_KEY" "Client/Info.plist"
35
else
36
/usr/libexec/PlistBuddy -c "Set PocketEnvironmentAPIKey $POCKET_STAGING_API_KEY" "Client/Info.plist"
37
fi
38
39
#
40
# Setup Sentry. We have different DSNs for Beta and Production.
41
#
42
43
if [ "$BUDDYBUILD_SCHEME" == FirefoxBeta ]; then
44
echo "Setting SentryDSN to $SENTRY_DSN_BETA"
45
/usr/libexec/PlistBuddy -c "Set SentryDSN $SENTRY_DSN_BETA" "Client/Info.plist"
46
elif [ "$BUDDYBUILD_SCHEME" == Firefox ]; then
47
echo "Setting SentryDSN to $SENTRY_DSN_RELEASE"
48
/usr/libexec/PlistBuddy -c "Set SentryDSN $SENTRY_DSN_RELEASE" "Client/Info.plist"
49
fi
50
51
#
52
# Set the build number to match the Buddybuild number
53
#
54
55
agvtool new-version -all "$BUDDYBUILD_BUILD_NUMBER"