|
| 1 | +#!/usr/bin/bash |
| 2 | + |
| 3 | +set -eux |
| 4 | + |
| 5 | +# Get the current unique version of this checkout |
| 6 | +# shellcheck disable=SC2154 |
| 7 | +if [ "${is_patch}" = "true" ]; then |
| 8 | + # shellcheck disable=SC2154 |
| 9 | + CURRENT_VERSION=$(git describe || echo "null")-patch-${version_id} |
| 10 | +else |
| 11 | + CURRENT_VERSION=latest |
| 12 | +fi |
| 13 | + |
| 14 | +# Python has cygwin path problems on Windows. |
| 15 | +DRIVERS_TOOLS="$(dirname "$(pwd)")/drivers-tools" |
| 16 | +PROJECT_DIRECTORY="$(pwd)" |
| 17 | + |
| 18 | +if [ "Windows_NT" = "${OS:-}" ]; then |
| 19 | + DRIVERS_TOOLS=$(cygpath -m $DRIVERS_TOOLS) |
| 20 | + PROJECT_DIRECTORY=$(cygpath -m $PROJECT_DIRECTORY) |
| 21 | +fi |
| 22 | +export PROJECT_DIRECTORY |
| 23 | +export DRIVERS_TOOLS |
| 24 | + |
| 25 | +export MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration" |
| 26 | +export MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin" |
| 27 | +# shellcheck disable=SC2154 |
| 28 | +export UPLOAD_BUCKET="${project}" |
| 29 | + |
| 30 | +cat <<EOT > expansion.yml |
| 31 | +CURRENT_VERSION: "$CURRENT_VERSION" |
| 32 | +DRIVERS_TOOLS: "$DRIVERS_TOOLS" |
| 33 | +MONGO_ORCHESTRATION_HOME: "$MONGO_ORCHESTRATION_HOME" |
| 34 | +MONGODB_BINARIES: "$MONGODB_BINARIES" |
| 35 | +UPLOAD_BUCKET: "$UPLOAD_BUCKET" |
| 36 | +PROJECT_DIRECTORY: "$PROJECT_DIRECTORY" |
| 37 | +EOT |
| 38 | + |
| 39 | +# Set up drivers-tools with a .env file. |
| 40 | +git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git ${DRIVERS_TOOLS} |
| 41 | +cat <<EOT > ${DRIVERS_TOOLS}/.env |
| 42 | +CURRENT_VERSION="$CURRENT_VERSION" |
| 43 | +DRIVERS_TOOLS="$DRIVERS_TOOLS" |
| 44 | +MONGO_ORCHESTRATION_HOME="$MONGO_ORCHESTRATION_HOME" |
| 45 | +MONGODB_BINARIES="$MONGODB_BINARIES" |
| 46 | +UPLOAD_BUCKET="$UPLOAD_BUCKET" |
| 47 | +PROJECT_DIRECTORY="$PROJECT_DIRECTORY" |
| 48 | +EOT |
0 commit comments