-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathci-deploy-fastlane-apk.sh
executable file
·54 lines (41 loc) · 1.18 KB
/
ci-deploy-fastlane-apk.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
48
49
50
51
52
53
54
#!/bin/bash
#------------------------------------------------------------------------
# A script to deploy a single Fastlane application.
#
#------------------------------------------------------------------------
# Utility methods
#
fatal()
{
echo "ci-deploy-fastlane-apk.sh: fatal: $1" 1>&2
exit 1
}
info()
{
echo "ci-deploy-fastlane-apk.sh: info: $1" 1>&2
}
#------------------------------------------------------------------------
if [ $# -ne 1 ]
then
fatal "usage: project"
fi
PROJECT="$1"
shift
CI_BIN_DIRECTORY=$(realpath .ci) ||
fatal "could not determine bin directory"
export PATH="${PATH}:${CI_BIN_DIRECTORY}:."
START_DIRECTORY=$(pwd) ||
fatal "could not retrieve starting directory"
cd "${PROJECT}" ||
fatal "could not switch to project directory"
CI_GEM_PATHS=$(gem environment gempaths | sed 's/:/ /g')
for CI_GEM_PATH in ${CI_GEM_PATHS}
do
CI_EXTRA_BIN="${CI_GEM_PATH}/bin"
info "adding ${CI_EXTRA_BIN} to PATH"
export PATH="${PATH}:${CI_EXTRA_BIN}"
done
CI_FASTLANE_APK=$(head -n 1 "fastlane-apk.conf") ||
fatal "could not read fastlane-apk.conf"
bundle exec fastlane supply --apk "${CI_FASTLANE_APK}" --track alpha < /dev/null ||
fatal "could not upload APK"