forked from mongodb/mongo-go-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GODRIVER-3338 Remove usage of PREPARE_SHELL in Evergreen Config (mong…
- Loading branch information
Showing
24 changed files
with
421 additions
and
521 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Source the env.sh file and run the given task | ||
set -eu | ||
|
||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
PROJECT_DIRECTORY=$(dirname $SCRIPT_DIR) | ||
pushd ${PROJECT_DIRECTORY} > /dev/null | ||
|
||
source env.sh | ||
task "$@" | ||
|
||
popd > /dev/null |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Set up environment and write env.sh and expansion.yml files. | ||
set -eu | ||
|
||
# Set up default environment variables. | ||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
PROJECT_DIRECTORY=$(dirname $SCRIPT_DIR) | ||
ROOT_DIR=$(dirname $PROJECT_DIRECTORY) | ||
DRIVERS_TOOLS=${DRIVERS_TOOLS:-${ROOT_DIR}/drivers-evergreen-tools} | ||
MONGO_ORCHESTRATION_HOME="${DRIVERS_TOOLS}/.evergreen/orchestration" | ||
MONGODB_BINARIES="${DRIVERS_TOOLS}/mongodb/bin" | ||
OS="${OS:-""}" | ||
|
||
# Set Golang environment vars. GOROOT is wherever current Go distribution is, and is set in evergreen config. | ||
# GOPATH is always 3 directories up from pwd on EVG; GOCACHE is under .cache in the pwd. | ||
GOROOT=${GOROOT:-$(dirname "$(dirname "$(which go)")")} | ||
export GOPATH=${GOPATH:-$ROOT_DIR} | ||
export GOCACHE="${GO_CACHE:-$PROJECT_DIRECTORY/.cache}" | ||
|
||
# Handle paths on Windows. | ||
if [ "Windows_NT" = "${OS:-}" ]; then # Magic variable in cygwin | ||
GOPATH=$(cygpath -m $GOPATH) | ||
GOCACHE=$(cygpath -w $GOCACHE) | ||
DRIVERS_TOOLS=$(cygpath -m $DRIVERS_TOOLS) | ||
PROJECT_DIRECTORY=$(cygpath -m $PROJECT_DIRECTORY) | ||
EXTRA_PATH=/cygdrive/c/libmongocrypt/bin | ||
MONGO_ORCHESTRATION_HOME=$(cygpath -m $MONGO_ORCHESTRATION_HOME) | ||
MONGODB_BINARIES=$(cygpath -m $MONGODB_BINARIES) | ||
# Set home variables for Windows, too. | ||
USERPROFILE=$(cygpath -w "$ROOT_DIR") | ||
HOME=$USERPROFILE | ||
else | ||
EXTRA_PATH=${GCC:-} | ||
fi | ||
|
||
# Add binaries to the path. | ||
PATH="${GOROOT}/bin:${GOPATH}/bin:${MONGODB_BINARIES}:${EXTRA_PATH}:${PATH}" | ||
|
||
# Get the current unique version of this checkout. | ||
if [ "${IS_PATCH:-}" = "true" ]; then | ||
CURRENT_VERSION=$(git describe)-patch-${VERSION_ID} | ||
else | ||
CURRENT_VERSION=latest | ||
fi | ||
|
||
# Ensure a checkout of drivers-tools. | ||
if [ ! -d "$DRIVERS_TOOLS" ]; then | ||
git clone https://github.com/mongodb-labs/drivers-evergreen-tools $DRIVERS_TOOLS | ||
fi | ||
|
||
# Write the .env file for drivers-tools. | ||
cat <<EOT > ${DRIVERS_TOOLS}/.env | ||
SKIP_LEGACY_SHELL=1 | ||
DRIVERS_TOOLS="$DRIVERS_TOOLS" | ||
MONGO_ORCHESTRATION_HOME="$MONGO_ORCHESTRATION_HOME" | ||
MONGODB_BINARIES="$MONGODB_BINARIES" | ||
TMPDIR="$MONGO_ORCHESTRATION_HOME/db" | ||
EOT | ||
|
||
# Check Go installation. | ||
go version | ||
go env | ||
|
||
# Install taskfile. | ||
go install github.com/go-task/task/v3/cmd/[email protected] | ||
|
||
# Write our own env file. | ||
cat <<EOT > env.sh | ||
export GOROOT="$GOROOT" | ||
export GOPATH="$GOPATH" | ||
export GOCACHE="$GOCACHE" | ||
export DRIVERS_TOOLS="$DRIVERS_TOOLS" | ||
export PROJECT_DIRECTORY="$PROJECT_DIRECTORY" | ||
export PATH="$PATH" | ||
EOT | ||
|
||
if [ "Windows_NT" = "$OS" ]; then | ||
echo "export USERPROFILE=$USERPROFILE" >> env.sh | ||
echo "export HOME=$HOME" >> env.sh | ||
fi | ||
|
||
# source the env.sh file and write the expansion file. | ||
cat <<EOT > expansion.yml | ||
CURRENT_VERSION: "$CURRENT_VERSION" | ||
DRIVERS_TOOLS: "$DRIVERS_TOOLS" | ||
PROJECT_DIRECTORY: "$PROJECT_DIRECTORY" | ||
RUN_TASK: "$PROJECT_DIRECTORY/.evergreen/run-task.sh" | ||
EOT | ||
|
||
cat env.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.