forked from couchbase/couchbase-lite-net
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
142 lines (134 loc) · 6.95 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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
pipeline {
agent any
options {
timeout(time: 30, unit: 'MINUTES')
}
stages {
stage("Entry") {
parallel {
stage("Windows Node") {
agent { label 'couchbase-lite-net-validation' }
environment {
NEXUS_REPO="http://nexus.build.couchbase.com:8081/nexus/content/repositories/releases/com/couchbase/litecore"
}
stages {
stage("Checkout") {
steps {
powershell '''
New-Item -Type Directory tmp
Get-ChildItem -Path $pwd -Exclude "tmp" -Force | Move-Item -Destination "tmp"
# Sometimes a PR depends on a PR in the EE repo as well. This needs to be convention based, so if there is a branch with the name PR-###
# (with the GH PR number) in the EE repo then use that, otherwise use the name of the target branch (master, release/XXX etc)
& 'C:\\Program Files\\Git\\bin\\git.exe' clone [email protected]:couchbaselabs/couchbase-lite-net-ee --branch $env:BRANCH_NAME --depth 1 couchbase-lite-net-ee
if($LASTEXITCODE -ne 0) {
& 'C:\\Program Files\\Git\\bin\\git.exe' clone [email protected]:couchbaselabs/couchbase-lite-net-ee --branch $env:CHANGE_TARGET --depth 1 couchbase-lite-net-ee
}
Get-ChildItem couchbase-lite-net-ee\\* -Force | Move-Item -Destination .
Get-ChildItem -Force tmp\\* | Move-Item -Destination couchbase-lite-net
Remove-Item tmp
Push-Location couchbase-lite-net
& 'C:\\Program Files\\Git\\bin\\git.exe' submodule update --init
Pop-Location
Push-Location jenkins
& 'C:\\Program Files\\Git\\bin\\git.exe' clone https://github.com/couchbaselabs/couchbase-lite-net-validation --depth 1 proj
Pop-Location
'''
}
}
stage(".NET Core Windows") {
steps {
powershell 'jenkins\\run_win_tests.ps1'
}
}
// Note: Jenkins is a PITA for this, so I will remove UWP from PR
// validation, but it will get checked in post-commit
// stage("UWP") {
// steps {
// powershell 'jenkins\\run_uwp_tests.ps1'
// }
// }
}
}
stage("Linux Node") {
agent { label 's61113u16 (litecore)' }
environment {
NEXUS_REPO="http://nexus.build.couchbase.com:8081/nexus/content/repositories/releases/com/couchbase/litecore"
}
stages {
stage("Checkout") {
steps {
sh '''#!/bin/bash
set -e
shopt -s extglob dotglob
mkdir tmp
mv !(tmp) tmp
git clone [email protected]:couchbaselabs/couchbase-lite-net-ee --branch $BRANCH_NAME --depth 1 couchbase-lite-net-ee || \
git clone [email protected]:couchbaselabs/couchbase-lite-net-ee --branch $CHANGE_TARGET --depth 1 couchbase-lite-net-ee
mv couchbase-lite-net-ee/* .
mv tmp/* couchbase-lite-net
rmdir tmp
pushd couchbase-lite-net
git submodule update --init
popd
pushd jenkins
git clone https://github.com/couchbaselabs/couchbase-lite-net-validation --depth 1 proj
popd
'''
}
}
stage(".NET Core Linux") {
steps {
sh 'jenkins/run_unix_tests.sh'
}
}
}
}
stage("Mac Node") {
agent { label 'mobile-mac-mini' }
environment {
NEXUS_REPO="http://nexus.build.couchbase.com:8081/nexus/content/repositories/releases/com/couchbase/litecore"
KEYCHAIN_PWD = credentials("mobile-mac-mini-keychain")
}
stages {
stage("Checkout") {
steps {
sh '''#!/bin/bash
set -e
shopt -s extglob dotglob
mkdir tmp
mv !(tmp) tmp
git clone [email protected]:couchbaselabs/couchbase-lite-net-ee --branch $BRANCH_NAME --depth 1 couchbase-lite-net-ee || \
git clone [email protected]:couchbaselabs/couchbase-lite-net-ee --branch $CHANGE_TARGET --depth 1 couchbase-lite-net-ee
mv couchbase-lite-net-ee/* .
mv tmp/* couchbase-lite-net
rmdir tmp
pushd couchbase-lite-net
git submodule update --init
popd
pushd jenkins
git clone https://github.com/couchbaselabs/couchbase-lite-net-validation --depth 1 proj
popd
'''
}
}
stage(".NET Core Mac") {
steps {
sh 'jenkins/run_unix_tests.sh'
}
}
stage("Xamarin iOS") {
steps {
sh 'jenkins/run_ios_tests.sh'
}
}
stage("Xamarin Android") {
steps {
sh 'jenkins/run_android_tests.sh'
}
}
}
}
}
}
}
}