forked from mongodb/mongo-java-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.evg.yml
More file actions
253 lines (220 loc) · 7.91 KB
/
.evg.yml
File metadata and controls
253 lines (220 loc) · 7.91 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
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
#########################################
# Java Driver Config for Evergreen #
#########################################
#######################################
# Functions #
#######################################
functions:
"fetch source" :
command: git.get_project
params:
directory: "mongo-java-driver"
"fetch mongodb" :
command: shell.exec
params:
working_dir: "mongo-java-driver"
script: |
set -o verbose
set -o errexit
ls -la
curl -s ${mongo_url} --output mongo-archive.${ext|tgz}
${decompress} mongo-archive.${ext|tgz}
mv mongodb* mongodb
chmod +x ./mongodb/bin/mongod${extension}
if [ ${windows|false} = true ]; then
rm -rf /cygdrive/c/mongodb
cp -r mongodb /cygdrive/c/mongodb
fi
"compile and analyze" :
command: shell.exec
params:
working_dir: "mongo-java-driver"
script: |
set -o verbose
set -o errexit
./gradlew -PxmlReports.enabled=true --info -x test clean check jar testClasses
"run tests" :
command: shell.exec
params:
working_dir: "mongo-java-driver"
script: |
set -o verbose
set -o errexit
export ORCHESTRATION_FILE="orchestration_configs/${topology_type}s/${orchestration_file}"
mkdir -p $(dirname "$ORCHESTRATION_FILE")
${start_mongo_orchestration}
${start_topology}
mongodb_test_uri="mongodb://${auth_uri_prefix}${hosts}"
./gradlew -Dorg.mongodb.test.uri=$mongodb_test_uri --stacktrace --info test
"attach junit results" :
command: attach.xunit_results
params:
file: ./mongo-java-driver/*/build/test-results/TEST-*.xml
"upload mo artifacts":
- command: shell.exec
params:
working_dir: "mongo-java-driver"
script: |
set -o verbose
set -o errexit
[ -d MO ] && find MO -name mongo*.log | xargs tar czf mongodb-logs.tgz
[ -f mongodb-logs.tgz ] && tar ztvf mongodb-logs.tgz
[ -d MO ] && tar czf mongodb-orchestration-logs.tgz MO/*.log
[ -f mongodb-orchestration-logs.tgz ] && tar ztvf mongodb-orchestration-logs.tgz
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: mongo-java-driver/mongodb-logs.tgz
remote_file: mongo-java-driver/${build_variant}/${revision}/${version_id}/${build_id}/logs/${task_id}-${execution}-mongodb-logs.tgz
bucket: mciuploads
permissions: public-read
content_type: ${content_type|application/x-gzip}
display_name: "mongodb-logs.tar.gz"
- command: s3.put
params:
aws_key: ${aws_key}
aws_secret: ${aws_secret}
local_file: mongo-java-driver/mongodb-orchestration-logs.tgz
remote_file: mongo-java-driver/${build_variant}/${revision}/${version_id}/${build_id}/logs/${task_id}-${execution}-mongodb-orchestration-logs.tgz
bucket: mciuploads
permissions: public-read
content_type: ${content_type|application/x-gzip}
display_name: "mongodb-orchestration-logs.tgz"
"cleanup" :
command: shell.exec
params:
working_dir: "mongo-java-driver"
script: |
set -o errexit
export MONGO_ORCHESTRATION_HOME=$(pwd)"/MO"
export TMPDIR=$MONGO_ORCHESTRATION_HOME/db
mongo-orchestration stop
#####################################
# Tasks #
#######################################
tasks:
- name: compileAndAnalyze
commands:
- func: "fetch source"
- func: "compile and analyze"
- name: test
depends_on:
- name: compileAndAnalyze
variant: compile
commands:
- func: "fetch source"
- func: "fetch mongodb"
- func: "run tests"
- func: "attach junit results"
- func: "upload mo artifacts"
- func: "cleanup"
#######################################
# Scripts #
#######################################
scripts:
## Scripts that are shared between buildvariants
scripts:
mongo_orchestration:
unix: &mongo_orchestration_unix
start_mongo_orchestration: |
echo "Starting MongoDB Orchestration..."
# Borrow MO config from the C driver
curl --location "https://raw.githubusercontent.com/mongodb/mongo-c-driver/master/orchestration_configs/${topology_type}s/${orchestration_file}" > "$ORCHESTRATION_FILE"
export ORCHESTRATION_URL="http://localhost:8889/v1/${topology_type}s"
export MONGO_ORCHESTRATION_HOME=$(pwd)"/MO"
rm -rf $MONGO_ORCHESTRATION_HOME
mkdir -p $MONGO_ORCHESTRATION_HOME/lib
mkdir -p $MONGO_ORCHESTRATION_HOME/db
echo "{ \"releases\": { \"default\": \"`pwd`/mongodb/bin\" } }" > orchestration.config
export TMPDIR=$MONGO_ORCHESTRATION_HOME/db
nohup mongo-orchestration -f orchestration.config -e default --socket-timeout-ms=60000 --bind=127.0.0.1 --enable-majority-read-concern start > $MONGO_ORCHESTRATION_HOME/out.log 2> $MONGO_ORCHESTRATION_HOME/err.log < /dev/null &
sleep 15
curl http://localhost:8889/ --silent --max-time 120 --fail
echo "MongoDB Orchestration started..."
sleep 5
start_topology_command: &start_topology_command
start_topology: |
echo "Starting MongoDB cluster..."
curl --silent --data @"$ORCHESTRATION_FILE" "$ORCHESTRATION_URL" --max-time 300 --fail
echo "MongoDB cluster started..."
#######################################
# Axes #
#######################################
axes:
- id: mongodb_version
display_name: MongoDB Version
values:
- id: "3.4"
display_name: "3.4"
variables:
mongodb_full_version: "3.4.0-rc2"
ubuntu_os_download: "ubuntu1604"
- id: "3.2"
display_name: "3.2"
variables:
mongodb_full_version: "3.2.10"
ubuntu_os_download: "ubuntu1604"
- id: "3.0"
display_name: "3.0"
variables:
mongodb_full_version: "3.0.12"
ubuntu_os_download: "ubuntu1404"
- id: "2.6"
display_name: "2.6"
variables:
mongodb_full_version: "2.6.12"
ubuntu_os_download: "ubuntu1404"
- id: auth
display_name: Authentication
values:
- id: "enabled"
display_name: "Auth Enabled"
variables:
auth_uri_prefix: "bob:pwd123@"
orchestration_file: "auth.json"
- id: "disabled"
display_name: "Auth Disabled"
variables:
auth_uri_prefix: ""
orchestration_file: "basic.json"
- id: os
display_name: OS
values:
- id: ubuntu1604
display_name: Ubuntu 16.04
run_on: ubuntu1604-test
variables:
<<: *start_topology_command
<<: *mongo_orchestration_unix
mongo_url: "http://downloads.mongodb.com/linux/mongodb-linux-x86_64-enterprise-${ubuntu_os_download}-${mongodb_full_version}.tgz"
- id: topology_type
display_name: Cluster Type
values:
- id: server
display_name: Standalone
variables:
hosts: "localhost:27017"
- id: replica_set
display_name: Replica Set
variables:
hosts: "localhost:27017,localhost:27018"
- id: sharded_cluster
display_name: Sharded
variables:
hosts: "localhost:27017"
#######################################
# Variants #
#######################################
buildvariants:
- name: compile
display_name: "Compile and Analyze"
tasks:
- name: compileAndAnalyze
run_on:
- ubuntu1604-test
- matrix_name: "test"
matrix_spec: {os: "*", topology_type: "*", mongodb_version: "*", auth: "*"}
display_name: "${os} ${topology_type} ${mongodb_version} ${auth}"
tasks:
- name: test