-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
49 lines (39 loc) · 910 Bytes
/
Jenkinsfile
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
def pullCodeFromGitHub() {
git url: 'https://github.com/dabaicaifen/twittermock.git'
sh(script: 'pod update', returnStatus: false)
}
def runUnitTest() {
def result = sh(script: 'bundle exec fastlane unit_tests --verbose && exit ${PIPESTATUS[0]}', returnStatus: true)
if (result != 0) {
error 'Fail Test-iOS'
}
}
def runUITest() {
def result = sh(script: 'bundle exec fastlane ui_tests && exit ${PIPESTATUS[0]}', returnStatus: true)
if (result != 0) {
error 'Fail Test-iOS'
}
}
node {
stage("Setup") {
try {
pullCodeFromGitHub()
} catch(e) {
throw e
}
}
stage("Unit Test") {
try {
runUnitTest()
} catch(e) {
throw e
}
}
stage("UI Test") {
try {
runUITest()
} catch(e) {
throw e
}
}
}