Skip to content

Commit

Permalink
More usability improvements for local server (#485)
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 authored Sep 3, 2024
1 parent 0d08c92 commit cf39786
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1303,15 +1303,15 @@ buildvariants:
- name: releng-release-archive-creator
display_name: "** Release Archive Creator"
run_on:
- ubuntu2004-large
- ubuntu2004-small
tasks:
- ".releng" # Run all tasks with the "releng" tag

# Tests relating to docker images
- name: tests-docker
display_name: Docker
run_on:
- ubuntu2204-large
- ubuntu2204-small
tasks:
- ".docker" # Run all tasks with the "docker" tag

Expand Down
1 change: 1 addition & 0 deletions .evergreen/docker/ubuntu18.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
curl \
wget \
sudo \
make \
gnupg \
python \
lsof \
Expand Down
11 changes: 3 additions & 8 deletions .evergreen/docker/ubuntu18.04/base-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
#!/usr/bin/env bash
set -eu

# Clear out files that might interfere.
rm -f $DRIVERS_TOOLS/results.json
rm -rf /tmp/mongo*
rm -f $DRIVERS_TOOLS/.env

# Start the server.
cd $DRIVERS_TOOLS/.evergreen
bash run-orchestration.sh
cd $DRIVERS_TOOLS
make run-server

# Preserve host permissions of files we have created.
cd $DRIVERS_TOOLS
files=(results.json uri.txt .evergreen/mongo_crypt_v1.so .evergreen/mo-expansion.yml)
files=(results.json uri.txt mongo_crypt_v1.so mo-expansion.yml)
chown --reference=action.yml "${files[@]}"
chmod --reference=action.yml "${files[@]}"

Expand Down
2 changes: 1 addition & 1 deletion .evergreen/docker/ubuntu18.04/test-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -eu

bash /root/base-entrypoint.sh
source $DRIVERS_TOOLS/.evergreen/mo-expansion.sh
source $DRIVERS_TOOLS/mo-expansion.sh
URI="mongodb://127.0.0.1:27017/?serverSelectionTimeoutMS=10000"
$MONGODB_BINARIES/mongosh $URI --eval "db.runCommand({\"ping\":1})"
echo "Test complete!"
1 change: 1 addition & 0 deletions .evergreen/docker/ubuntu20.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ RUN export DEBIAN_FRONTEND=noninteractive && \
ca-certificates \
curl \
wget \
make \
sudo \
gnupg \
python \
Expand Down
11 changes: 3 additions & 8 deletions .evergreen/docker/ubuntu20.04/base-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
#!/usr/bin/env bash
set -eu

# Clear out files that might interfere.
rm -f $DRIVERS_TOOLS/results.json
rm -rf /tmp/mongo*
rm -f $DRIVERS_TOOLS/.env

# Start the server.
cd $DRIVERS_TOOLS/.evergreen
bash run-orchestration.sh
cd $DRIVERS_TOOLS
make run-server

# Preserve host permissions of files we have created.
cd $DRIVERS_TOOLS
files=(results.json uri.txt .evergreen/mongo_crypt_v1.so .evergreen/mo-expansion.yml)
files=(results.json uri.txt mongo_crypt_v1.so mo-expansion.yml)
chown --reference=action.yml "${files[@]}"
chmod --reference=action.yml "${files[@]}"

Expand Down
2 changes: 1 addition & 1 deletion .evergreen/docker/ubuntu20.04/test-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -eu

bash /root/base-entrypoint.sh
source $DRIVERS_TOOLS/.evergreen/mo-expansion.sh
source $DRIVERS_TOOLS/mo-expansion.sh
URI="mongodb://127.0.0.1:27017/?serverSelectionTimeoutMS=10000"
$MONGODB_BINARIES/mongosh $URI --eval "db.runCommand({\"ping\":1})"
echo "Test complete!"
1 change: 1 addition & 0 deletions .evergreen/handle-paths.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ case "$(uname -s)" in
DRIVERS_TOOLS=$(cygpath -m "$DRIVERS_TOOLS")
# USERPROFILE is required by Python for pathlib.Path().expanduser(~).
if [ -z "${USERPROFILE:-}" ]; then
export USERPROFILE
USERPROFILE=$(cygpath -m "$HOME")
fi
;;
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@ all:
@echo "Project successfully compiled"

clean:
rm -rf mongodb
@echo "Cleaning files..."
rm -rf ./mongodb .env results.json mo-expansion*
rm -rf "$${TMPDIR:-$${TEMP:-$${TMP:-/tmp}}}"/mongo*

run-server: clean
@echo "Running server..."
.evergreen/run-orchestration.sh

stop-server:
@echo "Stopping server..."
.evergreen/stop-orchestration.sh

test:
Expand Down

0 comments on commit cf39786

Please sign in to comment.