-
Notifications
You must be signed in to change notification settings - Fork 57
/
buildAndCompare.sh
executable file
·47 lines (35 loc) · 1.18 KB
/
buildAndCompare.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
#!/bin/bash
set -e
echo "Which app would you like to build (type 'app' or 'instant')?"
read appName
echo Please enter KeystoreFile name:
read keystoreFile
echo Please enter Keystore Password:
read -s keystorePassword
echo Please enter KeyAlias:
read keyAlias
echo Please enter KeyAlias Password:
read -s keyAliasPassword
if [ "$appName" = "app" ] ; then
echo Please enter Build Timestamp:
read buildTimestamp
fi
#make sure we have a full clean build
rm -rf $appName/build
rm -rf common/build
rm -rf .gradle
docker build -t swisscovid-builder .
currentPath=`pwd`
if [ "$appName" = "app" ] ; then
command='assembleProdRelease'
else
command='bundleProdRelease'
fi
docker run --rm -v $currentPath:/home/swisscovid -w /home/swisscovid swisscovid-builder gradle $appName:$command -PkeystorePassword=$keystorePassword -PkeyAlias=$keyAlias -PkeyAliasPassword=$keyAliasPassword -PkeystoreFile=$keystoreFile -PbuildTimestamp=$buildTimestamp
if [ "$appName" = "app" ] ; then
cp $appName/build/outputs/apk/prod/release/$appName-prod-release.apk $appName-built.apk
if [[ $# -eq 1 ]] ; then
echo Comparing the built APK with the reference:
python apkdiff.py $appName-built.apk $1
fi
fi