Revision control

1
#!/usr/bin/env bash
2
3
# Only setup virtualenv if we intend on localizing the app.
4
function setup_virtualenv {
5
# Install Python tooling for localizations scripts
6
echo password | sudo easy_install pip
7
echo password | sudo -S pip install --upgrade pip
8
echo password | sudo -S pip install virtualenv
9
}
10
11
#
12
# Install Node.js dependencies and build user scripts
13
#
14
15
npm install
16
npm run build
17
18
#
19
# Import only the shipping locales (from shipping_locales.txt) on Release
20
# builds. Import all locales on Beta and Fennec_Enterprise, except for pull
21
# requests.
22
#
23
25
26
if [ "$BUDDYBUILD_SCHEME" = "Firefox" ]; then
27
setup_virtualenv
28
./ios-l10n-scripts/import-locales-firefox.sh --release
29
fi
30
31
if [ "$BUDDYBUILD_SCHEME" = "FirefoxBeta" ]; then
32
setup_virtualenv
33
./ios-l10n-scripts/import-locales-firefox.sh
34
fi
35
36
if [ "$BUDDYBUILD_SCHEME" = "Fennec_Enterprise" ] && [ "$BUDDYBUILD_PULL_REQUEST" = "" ]; then
37
setup_virtualenv
38
./ios-l10n-scripts/import-locales-firefox.sh
39
fi
40
41
# workaround, earlgrey needs to have dependencies downloaded before setup
43
carthage checkout
44
./Carthage/Checkouts/EarlGrey/Scripts/setup-earlgrey.sh
45
46
(cd content-blocker-lib-ios/ContentBlockerGen && swift run)
47
48
#
49
# Add a badge for FirefoxBeta
50
#
51
if [ "$BUDDYBUILD_SCHEME" = "FirefoxBeta" ]; then
52
brew install imagemagick
53
brew install ruby
54
_PATH=$PATH
55
export PATH=/usr/local/opt/ruby/bin:$PATH
56
export PATH=`gem env gemdir`/bin:$PATH
57
echo password | sudo -S gem install badge
58
CF_BUNDLE_SHORT_VERSION_STRING=$(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" Client/Info.plist)
59
badge --no_badge --shield_no_resize --shield "$CF_BUNDLE_SHORT_VERSION_STRING-Build%20$BUDDYBUILD_BUILD_NUMBER-blue"
60
# Reset the path
61
export PATH=$_PATH
62
fi