-
Notifications
You must be signed in to change notification settings - Fork 0
/
step.sh
82 lines (69 loc) · 2.27 KB
/
step.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
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
80
81
82
#!/usr/bin/env bash
set -ex
run_platform=$(echo "$platform" | awk '{print tolower($0)}')
command_args="run $run_platform"
command_args="$command_args --api-key $api_key"
command_args="$command_args --application $application"
command_args="$command_args --test-application $test_application"
command_args="$command_args --isolated $isolated"
if [ -n "$os_version" ]; then
command_args="$command_args --os-version $os_version"
fi
if [ -n "$link" ]; then
command_args="$command_args --link $link"
fi
if [ -n "$run_name" ]; then
command_args="$command_args --name $run_name"
fi
if [ -n "$ignore_test_failures" ]; then
command_args="$command_args --ignore-test-failures $ignore_test_failures"
fi
if [ -n "$system_image" ]; then
if [ "$run_platform" = "android" ]; then
command_args="$command_args --system-image $system_image"
else
echo "Error: The --system-image parameter is not supported for iOS."
exit 1
fi
fi
if [ -n "$output" ]; then
command_args="$command_args --output $output"
fi
if [ -n "$filter_file" ]; then
command_args="$command_args --filter-file $filter_file"
fi
if [ -n "$device" ]; then
command_args="$command_args --device $device"
fi
if [ -n "$xcode_version" ]; then
if [ "$run_platform" = "ios" ]; then
command_args="$command_args --xcode-version $xcode_version"
else
echo "Error: The --xcode-version parameter is not supported for Android."
exit 1
fi
fi
if [ -n "$xctestplan_filter_file" ]; then
if [ "$run_platform" = "ios" ]; then
command_args="$command_args --xctestplan-filter-file $xctestplan_filter_file"
else
echo "Error: The --xctestplan-filter-file parameter is not supported for Android."
exit 1
fi
fi
if [ -n "$xctestplan_target_name" ]; then
if [ "$run_platform" = "ios" ]; then
command_args="$command_args --xctestplan-target-name $xctestplan_target_name"
else
echo "Error: The --xctestplan-target-name parameter is not supported for Android."
exit 1
fi
fi
if [[ $OSTYPE == 'darwin'* ]]; then
echo 'macOS agents preinstall marathon-cloud cli via brew'
marathon-cloud $command_args
elif [[ $OSTYPE == 'linux'* ]]; then
echo 'using docker image $docker_image to pull the latest marathon-cloud cli version'
docker pull $docker_image
docker run -v "$(pwd)":/work --rm $docker_image $command_args
fi