diff --git a/.evergreen/config.yml b/.evergreen/config.yml index d24155e3..1843d5a8 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -41,6 +41,7 @@ functions: - command: git.apply_patch # Make an evergreen exapanstion file with dynamic values - command: subprocess.exec + include_expansions_in_env: ["is_patch", "version_id", "project"] params: working_dir: "src" binary: bash diff --git a/.evergreen/prepare-env-and-resources.sh b/.evergreen/prepare-env-and-resources.sh old mode 100644 new mode 100755 index 4baa8a3c..add2d504 --- a/.evergreen/prepare-env-and-resources.sh +++ b/.evergreen/prepare-env-and-resources.sh @@ -2,25 +2,28 @@ # PREPARE EVERGREEN ENVINROMENT # Get the current unique version of this checkout +# shellcheck disable=SC2154 if [ "${is_patch}" = "true" ]; then + # shellcheck disable=SC2154 CURRENT_VERSION=$(git describe)-patch-${version_id} else CURRENT_VERSION=latest fi -export DRIVERS_TOOLS="$(pwd)/../drivers-tools" -export PROJECT_DIRECTORY="$(pwd)" +DRIVERS_TOOLS="$(pwd)/../drivers-tools" +PROJECT_DIRECTORY="$(pwd)" # Python has cygwin path problems on Windows. Detect prospective mongo-orchestration home directory if [[ "$(uname -s)" == CYGWIN* ]]; then - export DRIVERS_TOOLS=$(cygpath -m $DRIVERS_TOOLS) - export PROJECT_DIRECTORY=$(cygpath -m $PROJECT_DIRECTORY) + DRIVERS_TOOLS=$(cygpath -m $DRIVERS_TOOLS) + PROJECT_DIRECTORY=$(cygpath -m $PROJECT_DIRECTORY) fi -export MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration" -export PROJECT_ORCHESTRATION_HOME="$PROJECT_DIRECTORY/.evergreen/orchestration" -export MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin" -export UPLOAD_BUCKET="${project}" +MONGO_ORCHESTRATION_HOME="$DRIVERS_TOOLS/.evergreen/orchestration" +PROJECT_ORCHESTRATION_HOME="$PROJECT_DIRECTORY/.evergreen/orchestration" +MONGODB_BINARIES="$DRIVERS_TOOLS/mongodb/bin" +# shellcheck disable=SC2154 +UPLOAD_BUCKET="${project}" cat <expansion.yml CURRENT_VERSION: "$CURRENT_VERSION" @@ -46,11 +49,12 @@ EOT cat expansion.yml # PREPARE RESOURCES -rm -rf ${DRIVERS_TOOLS} +rm -rf $DRIVERS_TOOLS if [ "${project}" = "drivers-tools" ]; then # If this was a patch build, doing a fresh clone would not actually test the patch - cp -R ${PROJECT_DIRECTORY}/ ${DRIVERS_TOOLS} + cp -R $PROJECT_DIRECTORY/ $DRIVERS_TOOLS else - git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git ${DRIVERS_TOOLS} + git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS fi -${DRIVERS_TOOLS}/.evergreen/setup.sh + +$DRIVERS_TOOLS/.evergreen/setup.sh