@@ -212,6 +212,55 @@ functions:
212
212
- command : expansions.update
213
213
params :
214
214
file : src/serverless-expansion.yml
215
+ - command : shell.exec
216
+ params :
217
+ shell : " bash"
218
+ script : |
219
+ ${PREPARE_SHELL}
220
+
221
+ if [ -z "${SERVERLESS_MONGODB_VERSION}" ]; then
222
+ echo "expected SERVERLESS_MONGODB_VERSION to be set"
223
+ exit 1
224
+ fi
225
+
226
+ # Download the enterprise server download for current platform to $MONGODB_BINARIES.
227
+ # This is required for tests that need mongocryptd.
228
+ # $MONGODB_BINARIES is added to the $PATH in fetch-source.
229
+ ${PYTHON3_BINARY} $DRIVERS_TOOLS/.evergreen/mongodl.py \
230
+ --component archive \
231
+ --version ${SERVERLESS_MONGODB_VERSION} \
232
+ --edition enterprise \
233
+ --out $MONGODB_BINARIES \
234
+ --strip-path-components 2
235
+
236
+ # Download the crypt_shared dynamic library for the current platform.
237
+ ${PYTHON3_BINARY} $DRIVERS_TOOLS/.evergreen/mongodl.py \
238
+ --component crypt_shared \
239
+ --version ${SERVERLESS_MONGODB_VERSION} \
240
+ --edition enterprise \
241
+ --out . \
242
+ --only "**/mongo_crypt_v1.*" \
243
+ --strip-path-components 1
244
+
245
+ # Find the crypt_shared library file in the current directory and set the CRYPT_SHARED_LIB_PATH to
246
+ # the path of that file. Only look for .so, .dll, or .dylib files to prevent matching any other
247
+ # downloaded files.
248
+ CRYPT_SHARED_LIB_PATH="$(find $(pwd) -maxdepth 1 -type f \
249
+ -name 'mongo_crypt_v1.so' -o \
250
+ -name 'mongo_crypt_v1.dll' -o \
251
+ -name 'mongo_crypt_v1.dylib')"
252
+
253
+ # If we're on Windows, convert the "cygdrive" path to Windows-style paths.
254
+ if [ "Windows_NT" = "$OS" ]; then
255
+ CRYPT_SHARED_LIB_PATH=$(cygpath -m $CRYPT_SHARED_LIB_PATH)
256
+ fi
257
+
258
+ echo "CRYPT_SHARED_LIB_PATH: $CRYPT_SHARED_LIB_PATH" >> crypt-expansion.yml
259
+
260
+ # Load the expansion file to make an evergreen variable with the current unique version
261
+ - command : expansions.update
262
+ params :
263
+ file : crypt-expansion.yml
215
264
216
265
" delete serverless instance " :
217
266
- command : shell.exec
0 commit comments