This repository has been archived by the owner on Aug 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Jenkinsfile
71 lines (66 loc) · 2.23 KB
/
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
@Library('general-pipeline') _
def clone(udid) {
checkout changelog: true, poll: true, scm: [$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class: 'RelativeTargetDirectory', relativeTargetDir: "$udid/ios-engage-sdk"]], submoduleCfg: [], userRemoteConfigs: [[url: '[email protected]:emartech/ios-mobile-engage-sdk.git']]]
}
def podi(udid) {
lock("pod") {
sh "pod repo update"
sh "cd $udid/ios-engage-sdk && pod install --verbose"
}
}
def podiLinti(udid) {
lock(udid) {
sh "cd $udid/ios-engage-sdk && pod lib lint --allow-warnings [email protected]:emartech/pod-private.git,master"
}
}
def buildAndTest(platform, udid) {
lock(udid) {
def uuid = UUID.randomUUID().toString()
try {
sh "mkdir /tmp/$uuid"
retry(3) {
sh "cd $udid/ios-engage-sdk && scan --scheme MobileEngageTests -d 'platform=$platform,id=$udid' --derived_data_path $uuid -o test_output/unit/"
}
} catch(e) {
currentBuild.result = 'FAILURE'
throw e
} finally {
junit "$udid/ios-engage-sdk/test_output/unit/*.junit"
archiveArtifacts "$udid/ios-engage-sdk/test_output/unit/*"
}
}
}
node('master') {
withSlack channel:'jenkins', {
stage('Start'){
deleteDir()
}
stage('Git Clone') {
parallel iOS_9_3_Simulator: {
clone env.IOS93SIMULATOR
}, failFast: false
}
stage('Pod install') {
sh 'eval $(ssh-agent) && ssh-add ~/.ssh/ios-core && ssh-add ~/.ssh/ios-pod-private-repo'
parallel iOS_9_3_Simulator: {
podi env.IOS93SIMULATOR
}, failFast: false
}
stage('Pod lint'){
parallel iOS_9_3_Simulator: {
podiLinti env.IOS93SIMULATOR
}, failFast: false
}
stage('Build and Test'){
parallel iOS_9_3_Simulator: {
buildAndTest 'iOS Simulator', env.IOS93SIMULATOR
}, failFast: false
}
stage('Deploy to private pod repo'){
sh "cd $env.IPAD_PRO/ios-engage-sdk && ./deploy-to-private-pod-repo.sh ${env.BUILD_NUMBER}.0.0"
}
stage('Finish'){
echo "That is just pure awesome!"
}
}
}