forked from RestComm/restcomm-android-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.bash
More file actions
executable file
·110 lines (98 loc) · 2.98 KB
/
main.bash
File metadata and controls
executable file
·110 lines (98 loc) · 2.98 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/bin/bash
#
# Main script that will drive CI/CD actions, depending on type of commit.
echo
echo "== "
echo "== Processing main script."
echo "== "
echo
# TODO: Run integration tests - TODO: take this out to a separate script
#echo "-- Running Integration Tests ."
#if [ -z "$SKIP_INTEGRATION_TESTS" ] || [[ "$SKIP_INTEGRATION_TESTS" == "false" ]]
#then
# # TODO: this should become a single line both for local and travis builds
# if [ ! -z "$TRAVIS" ]
# then
# #set -o pipefail && travis_retry xcodebuild test -workspace Test-App/Sample.xcworkspace -scheme Sample -destination 'platform=iOS Simulator,name=iPhone SE,OS=10.0' | xcpretty
# #xcodebuild test -workspace Test-App/Sample.xcworkspace -scheme Sample -destination 'platform=iOS Simulator,name=iPhone SE'
# # TODO: add travis IT
# else
# # For local builds don't specify iOS version, to make it more flexible
# #xcodebuild test -workspace Test-App/Sample.xcworkspace -scheme Sample -destination 'platform=iOS Simulator,name=iPhone SE' | xcpretty
# # TODO: add local IT
# fi
#else
# echo "-- Skipping Integration Tests."
#fi
#if [ ! -z "$TRAVIS" ]
#then
# This is a travis build
# if [[ "$TRAVIS_PULL_REQUEST" == "true" ]]; then
# echo "-- This is a pull request, bailing out."
# exit 0
# fi
# CURRENT_BRANCH is the brach we are passing from the travis CI settings and shows which branch CI should deploy from
#if [[ "$TRAVIS_BRANCH" != "$CURRENT_BRANCH" ]]; then
# echo "-- Testing on a branch other than $CURRENT_BRANCH, bailing out."
# exit 0
#fi
#fi
if ! ./scripts/setup-prerequisites.bash
then
exit 1
fi
# Execute instrumented UI Tests
if [ -z "$SKIP_OLYMPUS_UI_TESTS" ] || [[ "$SKIP_OLYMPUS_UI_TESTS" == "false" ]]
then
if ! ./scripts/handle-ui-tests.bash
then
exit 1
fi
else
echo "-- Skipping UI Tests."
fi
# Update reference documentation (trusted build only due to need to have write privileges to GitHub upstream repo)
if [ "$CURRENT_BRANCH" == $RELEASE_BRANCH ] && [[ -z "$SKIP_DOC_GENERATION" || "$SKIP_DOC_GENERATION" == "false" ]]
then
if [ -z $TRUSTED_BUILD ]
then
echo "-- Cannot generate doc in an untrusted build, skipping"
else
if ! ./scripts/update-doc.bash
then
exit 1
fi
fi
else
echo "-- Skipping Documentation Generation."
fi
# Build and upload Olympus to Test Fairy (strusted build only)
if [ "$CURRENT_BRANCH" == $RELEASE_BRANCH ] && [[ -z "$SKIP_TF_UPLOAD" || "$SKIP_TF_UPLOAD" == "false" ]]
then
if [ -z $TRUSTED_BUILD ]
then
echo "Cannot generate doc in an untrusted build, skipping"
else
if ! ./scripts/upload-olympus-to-testfairy.bash
then
exit 1
fi
fi
else
echo "-- Skipping Test Fairy upload."
fi
# Build SDK and publish to maven repo (trusted build)
if [ "$CURRENT_BRANCH" == $RELEASE_BRANCH ] && [[ -z "$SKIP_SDK_PUBLISH_TO_MAVEN_REPO" || "$SKIP_SDK_PUBLISH_TO_MAVEN_REPO" == "false" ]]
then
if [ -z $TRUSTED_BUILD ]
then
echo "Cannot generate doc in an untrusted build, skipping"
else
if ! ./scripts/publish-sdk.bash
then
exit 1
fi
fi
else
echo "-- Skipping SDK publishing."
fi