-
Notifications
You must be signed in to change notification settings - Fork 297
/
Jenkinsfile
59 lines (55 loc) · 2.26 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
pipeline {
options {
disableConcurrentBuilds()
}
agent { label 'sonoma' }
stages {
stage('Cleanup'){
steps {
sh """
#clean up DerivedData and tmp directories
#shutdown all simulators, in case if any device in "booted" state which doesn't allow data file to be deleted.
xcrun simctl shutdown all
xcrun simctl erase all
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf /tmp/Developer/CoreSimulator
rm -rf /tmp/com.apple.mobileassetd
rm -rf /tmp/com.apple.launchd*
rm -rf /tmp/com.apple.CoreSimulator*
"""
}
}
stage('Checkout'){
steps {
sh """
#!/bin/bash
set -e
shopt -s extglob dotglob
# move PR related repo to tmp folder
mkdir couchbase-lite-ios
mv !(couchbase-lite-ios) couchbase-lite-ios
# submodule update inside lite-ios
pushd couchbase-lite-ios
git submodule update --init --recursive
popd
# Sometimes the PR depends on a PR in the EE repo as well. It will look for a branch with the same name as the one in CE repo. If not found, use the name of the target branch (master, release/XXX etc)
# clone the EE-repo
git clone [email protected]:couchbaselabs/couchbase-lite-ios-ee.git --branch $CHANGE_BRANCH || \
git clone [email protected]:couchbaselabs/couchbase-lite-ios-ee.git --branch $CHANGE_TARGET
# submodule update for core-EE
pushd couchbase-lite-ios-ee
git submodule update --init --recursive
popd
./couchbase-lite-ios-ee/Scripts/prepare_project.sh
"""
}
}
stage('Build'){
steps {
sh """
./couchbase-lite-ios/Scripts/pull_request_build_test.sh
"""
}
}
}
}