Skip to content

Commit 918740d

Browse files
committed
PYTHON-5016 Create spawn host helper scripts
1 parent bdaf43c commit 918740d

6 files changed

+56
-8
lines changed

.evergreen/install-dependencies.sh

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/bin/bash
2-
set -o xtrace # Write all commands first to stderr
3-
set -o errexit # Exit the script with error if any of the commands fail
2+
set -eu
43

54
# Copy PyMongo's test certificates over driver-evergreen-tools'
65
cp ${PROJECT_DIRECTORY}/test/certificates/* ${DRIVERS_TOOLS}/.evergreen/x509gen/
@@ -9,7 +8,7 @@ cp ${PROJECT_DIRECTORY}/test/certificates/* ${DRIVERS_TOOLS}/.evergreen/x509gen/
98
cp ${PROJECT_DIRECTORY}/test/certificates/client.pem ${MONGO_ORCHESTRATION_HOME}/lib/client.pem
109

1110
# Ensure hatch is installed.
12-
bash ${PROJECT_DIRECTORY}/scripts/ensure-hatch.sh
11+
bash ${PROJECT_DIRECTORY}/.evergreen/scripts/ensure-hatch.sh
1312

1413
if [ -w /etc/hosts ]; then
1514
SUDO=""

.evergreen/scripts/configure-env.sh

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
#!/bin/bash -eux
1+
#!/bin/bash
2+
3+
set -eu
24

35
# Get the current unique version of this checkout
46
# shellcheck disable=SC2154
5-
if [ "$is_patch" = "true" ]; then
7+
if [ "${is_patch:-}" = "true" ]; then
68
# shellcheck disable=SC2154
79
CURRENT_VERSION="$(git describe)-patch-$version_id"
810
else
@@ -14,7 +16,7 @@ DRIVERS_TOOLS="$(dirname $PROJECT_DIRECTORY)/drivers-tools"
1416
CARGO_HOME=${CARGO_HOME:-${DRIVERS_TOOLS}/.cargo}
1517

1618
# Python has cygwin path problems on Windows. Detect prospective mongo-orchestration home directory
17-
if [ "Windows_NT" = "$OS" ]; then # Magic variable in cygwin
19+
if [ "Windows_NT" = "${OS:-}" ]; then # Magic variable in cygwin
1820
DRIVERS_TOOLS=$(cygpath -m $DRIVERS_TOOLS)
1921
PROJECT_DIRECTORY=$(cygpath -m $PROJECT_DIRECTORY)
2022
CARGO_HOME=$(cygpath -m $CARGO_HOME)
+7-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
#!/bin/bash
2+
set -eu
3+
4+
HERE=$(dirname ${BASH_SOURCE:-$0})
5+
pushd $HERE
6+
. env.sh
27

3-
. src/.evergreen/scripts/env.sh
4-
set -o xtrace
58
rm -rf $DRIVERS_TOOLS
69
if [ "$PROJECT" = "drivers-tools" ]; then
710
# If this was a patch build, doing a fresh clone would not actually test the patch
@@ -10,3 +13,5 @@ else
1013
git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS
1114
fi
1215
echo "{ \"releases\": { \"default\": \"$MONGODB_BINARIES\" }}" >$MONGO_ORCHESTRATION_HOME/orchestration.config
16+
17+
popd

.evergreen/scripts/setup-system.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
set -eu
4+
5+
HERE=$(dirname ${BASH_SOURCE:-$0})
6+
pushd $(dirname $(dirname $HERE))
7+
echo "Setting up system..."
8+
bash .evergreen/scripts/configure-env.sh
9+
source .evergreen/scripts/env.sh
10+
bash .evergreen/scripts/prepare-resources.sh
11+
bash $DRIVERS_TOOLS/.evergreen/setup.sh
12+
bash .evergreen/scripts/install-dependencies.sh
13+
popd
14+
echo "Setting up system... done."

.evergreen/setup-spawn-host.sh

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
set -eu
4+
5+
if [ -z "$1" ]
6+
then
7+
echo "Must supply a spawn host URL!"
8+
fi
9+
10+
target=$1
11+
12+
echo "Copying files to $target..."
13+
rsync -az -e ssh --exclude '.git' --filter=':- .gitignore' -r . $target:/home/ec2-user/mongo-python-driver
14+
echo "Copying files to $target... done"
15+
16+
ssh $target /home/ec2-user/mongo-python-driver/.evergreen/scripts/setup-system.sh

.evergreen/sync-spawn-host.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
if [ -z "$1" ]
4+
then
5+
echo "Must supply a spawn host URL!"
6+
fi
7+
8+
target=$1
9+
10+
echo "Syncing files to $target..."
11+
fswatch -o . | while read f; do rsync -hazv -e ssh --exclude '.git' --filter=':- .gitignore' -r . $target:/home/ec2-user/mongo-python-driver; done
12+
echo "Syncing files to $target... done."

0 commit comments

Comments
 (0)