-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CSHARP-5117: EG script to run tests from other repos (#1338)
- Loading branch information
1 parent
2f5beb8
commit 2b03289
Showing
2 changed files
with
89 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -o xtrace # Write all commands first to stderr | ||
set -o errexit # Exit the script with error if any of the commands fail | ||
|
||
# clone the repo | ||
rm -rf "${LOCAL_PATH}" | ||
mkdir "${LOCAL_PATH}" | ||
cd "${LOCAL_PATH}" || exit | ||
|
||
git clone -b "${GIT_BRANCH:-main}" --single-branch "${GIT_REPO}" . | ||
|
||
# add/adjust nuget.config pointing to myget so intermediate versions could be restored | ||
if [ -f "./nuget.config" ]; then | ||
echo "Adding myget into nuget.config" | ||
dotnet nuget add source https://www.myget.org/F/mongodb/api/v3/index.json -n myget.org --configfile ./nuget.config | ||
else | ||
echo "Creating custom nuget.config" | ||
cat > "nuget.config" << EOL | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<packageSources> | ||
<clear /> | ||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" /> | ||
<add key="myget.org" value="https://www.myget.org/F/mongodb/api/v3/index.json" /> | ||
</packageSources> | ||
</configuration> | ||
EOL | ||
fi | ||
|
||
# make files executable | ||
for i in $(find "." -name \*.sh); do | ||
chmod +x $i | ||
done | ||
|
||
# execute the provided script | ||
eval "$SCRIPT" |