Skip to content

PHPLIB-1410: Invoke drivers-evergreen-tools scripts with bash #1267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .evergreen/compile-extension.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
set -o errexit # Exit the script with error if any of the commands fail

PATH="$PHP_PATH/bin:$PATH"
Expand Down
33 changes: 22 additions & 11 deletions .evergreen/config/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,17 @@ functions:
params:
script: |
${PREPARE_SHELL}
SKIP_CRYPT_SHARED=${SKIP_CRYPT_SHARED} SKIP_LEGACY_SHELL=true MONGODB_VERSION=${MONGODB_VERSION} ORCHESTRATION_FILE=${ORCHESTRATION_FILE} TOPOLOGY=${TOPOLOGY} AUTH=${AUTH} SSL=${SSL} STORAGE_ENGINE=${STORAGE_ENGINE} LOAD_BALANCER=${LOAD_BALANCER} REQUIRE_API_VERSION=${REQUIRE_API_VERSION} ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
SKIP_CRYPT_SHARED=${SKIP_CRYPT_SHARED} \
SKIP_LEGACY_SHELL=true \
MONGODB_VERSION=${MONGODB_VERSION} \
ORCHESTRATION_FILE=${ORCHESTRATION_FILE} \
TOPOLOGY=${TOPOLOGY} \
AUTH=${AUTH} \
SSL=${SSL} \
STORAGE_ENGINE=${STORAGE_ENGINE} \
LOAD_BALANCER=${LOAD_BALANCER} \
REQUIRE_API_VERSION=${REQUIRE_API_VERSION} \
bash ${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh
# run-orchestration generates expansion file with MONGODB_URI and CRYPT_SHARED_LIB_PATH
- command: expansions.update
params:
Expand All @@ -152,7 +162,7 @@ functions:
params:
script: |
${PREPARE_SHELL}
${DRIVERS_TOOLS}/.evergreen/stop-orchestration.sh
bash ${DRIVERS_TOOLS}/.evergreen/stop-orchestration.sh
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After reading DRIVERS-2852 I understand that this is a temporary change during migration from sh to full bash.


"bootstrap mongohoused":
- command: shell.exec
Expand All @@ -161,14 +171,14 @@ functions:
cd ${DRIVERS_TOOLS}/.evergreen/atlas_data_lake

DRIVERS_TOOLS="${DRIVERS_TOOLS}" \
./pull-mongohouse-image.sh
bash ./pull-mongohouse-image.sh
- command: shell.exec
params:
script: |
cd ${DRIVERS_TOOLS}/.evergreen/atlas_data_lake

DRIVERS_TOOLS="${DRIVERS_TOOLS}" \
./run-mongohouse-image.sh
bash ./run-mongohouse-image.sh

"create serverless instance":
- command: subprocess.exec
Expand Down Expand Up @@ -235,7 +245,7 @@ functions:
PHP_VERSION=${PHP_VERSION} \
SSL=${SSL} \
TESTS=${TESTS} \
${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh

"run atlas data lake test":
- command: shell.exec
Expand All @@ -248,7 +258,7 @@ functions:

MONGODB_URI="mongodb://mhuser:[email protected]:27017" \
TESTS="atlas-data-lake" \
${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh

"run serverless tests":
- command: shell.exec
Expand Down Expand Up @@ -284,7 +294,7 @@ functions:
CRYPT_SHARED_LIB_PATH=${CRYPT_SHARED_LIB_PATH} \
MONGODB_URI="${SERVERLESS_URI}" \
TESTS="serverless" \
${PROJECT_DIRECTORY}/.evergreen/run-tests.sh
bash ${PROJECT_DIRECTORY}/.evergreen/run-tests.sh

"cleanup":
- command: shell.exec
Expand All @@ -310,7 +320,7 @@ functions:
${PREPARE_SHELL}
file="${PROJECT_DIRECTORY}/.evergreen/install-dependencies.sh"
# Don't use ${file} syntax here because evergreen treats it as an empty expansion.
[ -f "$file" ] && sh $file || echo "$file not available, skipping"
[ -f "$file" ] && bash $file || echo "$file not available, skipping"

"install composer":
- command: shell.exec
Expand All @@ -321,13 +331,14 @@ functions:
${PREPARE_SHELL}
file="${PROJECT_DIRECTORY}/.evergreen/install-composer.sh"
# Don't use ${file} syntax here because evergreen treats it as an empty expansion.
[ -f "$file" ] && DEPENDENCIES=${DEPENDENCIES} sh $file || echo "$file not available, skipping"
[ -f "$file" ] && DEPENDENCIES=${DEPENDENCIES} bash $file || echo "$file not available, skipping"

"start load balancer":
- command: shell.exec
params:
script: |
MONGODB_URI="${MONGODB_URI}" ${DRIVERS_TOOLS}/.evergreen/run-load-balancer.sh start
MONGODB_URI="${MONGODB_URI}" \
bash ${DRIVERS_TOOLS}/.evergreen/run-load-balancer.sh start
- command: expansions.update
params:
file: lb-expansion.yml
Expand All @@ -338,7 +349,7 @@ functions:
script: |
# Only run if a load balancer was started
if [ -n "${SINGLE_MONGOS_LB_URI}" ]; then
${DRIVERS_TOOLS}/.evergreen/run-load-balancer.sh stop
bash ${DRIVERS_TOOLS}/.evergreen/run-load-balancer.sh stop
fi

"start kms servers":
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/install-composer.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
set -o errexit # Exit the script with error if any of the commands fail

# Supported environment variables
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/install-dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
set -o errexit # Exit the script with error if any of the commands fail

# Functions to fetch MongoDB binaries
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
set -o errexit # Exit the script with error if any of the commands fail

# Supported environment variables
Expand Down