-
Notifications
You must be signed in to change notification settings - Fork 0
/
orb.yml
79 lines (73 loc) · 2.91 KB
/
orb.yml
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
version: 2.1
description: Upload a new build to TestFairy.
display:
home_url: https://www.testfairy.com/
source_url: https://github.com/testfairy/circleci-testfairy-orb
commands:
uploader:
parameters:
file:
description: APK or IPA file data.
type: string
api-key:
description: The envrionment variable name containing your API application key. See https://app.testfairy.com/settings for details.
type: env_var_name
symbols-file:
description: Symbols mapping file. For iOS this should be a path to the zipped symbols file. For Android, this is the path to the mappings.txt file
type: string
default: ""
testers-groups:
description: Either a comma-separated list of tester groups to be invited on the new build, or "all" to invite all testers.
type: string
default: ""
notify:
description: Send email to all users in tester_groups. The default is "on".
type: enum
enum: ["on", "off"]
default: "on"
auto-update:
description: Allows an easy upgrade of all users to the current version. The default is "off", to enable set as "on".
type: enum
enum: ["on", "off"]
default: "off"
tags:
description: Set of comma-separated tags to be displayed and search upon.
type: string
default: ""
server-endpoint:
description: API URL for TestFairy. The default is https://upload.testfairy.com
type: string
default: https://upload.testfairy.com
changelog:
description: Changelog for this upload.
type: string
default: ""
steps:
- run:
name: Uploading app to TestFairy
command: |
CHANGELOG="<< parameters.changelog >>"
if [ -z "${CHANGELOG}" ]; then
CHANGELOG=$(git log --format=oneline -n 1 $CIRCLE_SHA1)
fi
SYMBOLS="<< parameters.symbols-file >>"
if [ ! -z "${SYMBOLS}" ]; then
SYMBOLS="@${SYMBOLS}"
fi
JSON=$( curl -s << parameters.server-endpoint >>/api/upload/ \
-F api_key="$<< parameters.api-key >>" \
-F file="@<< parameters.file >>" \
-F symbols_file="${SYMBOLS}" \
-F auto-update="<< parameters.auto-update >>" \
-F notify="<< parameters.notify >>" \
-F testers-groups="<< parameters.testers-groups >>" \
-F tags="<< parameters.tags >>" \
-F changelog="${CHANGELOG}" \
-A "TestFairy CircleCI Uploader" )
URL=$( echo ${JSON} | sed 's/\\\//\//g' | sed -n 's/.*"build_url"\s*:\s*"\([^"]*\)".*/\1/p' )
if [ -z "$URL" ]; then
echo "Upload failed ${JSON}"
exit 1
fi
echo "Build was successfully uploaded to TestFairy and is available at:"
echo ${URL}