Revision control

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