-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrun
executable file
·79 lines (68 loc) · 1.72 KB
/
run
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
set -eu -o pipefail
PROJECT_ROOT=$(pwd)
PROGRAM_NAME=$0
function android-tests {
npm install
npx jetify
cd android
bundle install
bundle exec fastlane install_plugins
bundle exec fastlane android tests
cd $PROJECT_ROOT
}
function ios-tests {
npm install
cd ios
pod install
cd $PROJECT_ROOT
react-native link
cd ios
bundle install
bundle exec fastlane ios tests
cd $PROJECT_ROOT
}
function copy-google-service-account() {
cp infra/secrets/dev/google-services.json android/app
cp infra/secrets/dev/newagent-55cc5-063ad922bb70.json android
}
function checkout-branch-beta-release() {
git remote set-url origin https://${GITHUB_TOKEN}@github.com/georgeracu/947g5.git
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch --all
git checkout $BETA_RELEASE_BRANCH
}
function usage {
echo ""
echo "Example usage: $PROGRAM_NAME [command]"
echo ""
echo "Available commands"
echo " android-tests runs all Android tests using fastlane"
echo " ios-tests runs all iOS tests using fastlane"
echo " copy-google-service-account Copy files from secrets into the android app based on the environment"
echo " checkout-branch-beta-release Checkout branch beta-release"
echo " help | --help | -h all available commands"
echo ""
exit 1
}
function help {
usage
}
function --help {
usage
}
function -h {
usage
}
CMD=${1:-}
shift || true
case ${CMD} in
android-tests) android-tests;;
ios-tests) ios-tests;;
copy-google-service-account) copy-google-service-account;;
checkout-branch-beta-release) checkout-branch-beta-release;;
help) help;;
--help) help;;
--h) help;;
*) usage ;;
esac