Skip to content

Commit 6909518

Browse files
committed
wip
1 parent f822f31 commit 6909518

File tree

4 files changed

+32
-13
lines changed

4 files changed

+32
-13
lines changed

.evergreen/config.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,12 @@ tasks:
5151
binary: bash
5252
args:
5353
- .evergreen/scripts/resync-all-specs.sh
54+
working_dir: src
55+
56+
buildvariants:
57+
- name: resync_specs
58+
display_name: "Resync Specs"
59+
run_on: rhel80-small
60+
patchable: true
61+
tasks:
62+
- name: resync_specs

.evergreen/resync-specs.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
set -eu
44
PYMONGO=$(dirname "$(cd "$(dirname "$0")"; pwd)")
55
SPECS=${MDB_SPECS:-~/Work/specifications}
6+
echo "$SPECS"
67

78
help (){
89
echo "Usage: resync_specs.sh [-bcsp] spec"

.evergreen/scripts/create-pr.sh

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,37 @@
11
#!/usr/bin/env bash
22

3-
# Get a github access token for the git checkout.
4-
echo "Getting github token..."
53
# clone drivers-evergreen-tools to get this get-access-token script...
6-
tools="../../../drivers-evergreen-tools"
4+
tools="../drivers-evergreen-tools"
75
git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git $tools
6+
body="$(cat "$1")"
7+
8+
pushd $tools/.evergreen/github_app
9+
10+
# Get a github access token for the git checkout.
11+
echo "Getting github token..."
812

913
owner="mongodb"
1014
repo="mongo-python-driver"
11-
token=$(bash $tools/.evergreen/github_app/get-access-token.sh $repo $owner)
15+
16+
./setup-secrets.sh
17+
echo "finish setting up secrets"
18+
token=$(bash ./get-access-token.sh $repo $owner)
1219
if [ -z "${token}" ]; then
1320
echo "Failed to get github access token!"
21+
popd
1422
exit 1
1523
fi
1624
echo "Getting github token... done."
1725

1826
# Make the git checkout and create a new branch.
1927
echo "Creating the git checkout..."
2028
branch="spec-resync-"$(date '+%m-%d-%Y')
21-
body="$(cat spec_sync.txt)"
2229

2330
git config user.email "167856002+mongodb-dbx-release-bot[bot]@users.noreply.github.com"
2431
git config user.name "mongodb-dbx-release-bot[bot]"
2532
git remote set-url origin https://x-access-token:${token}@github.com/$owner/$repo.git
26-
git checkout -b $branch "origin/main"
33+
git checkout -b $branch "origin/master"
34+
git add
2735
echo "Creating the git checkout... done."
2836

2937
git push origin $branch

.evergreen/scripts/resync-all-specs.sh

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env bash
22
# Run spec syncing script and create PR
33

4-
SPEC_DEST="../../test"
4+
SPEC_DEST="test"
55
SRC_URL="https://github.com/mongodb/specifications.git"
66
# needs to be set for resunc-specs.sh
7-
SPEC_SRC="../../../specifications"
8-
SCRIPT="../resync-specs.sh"
7+
SPEC_SRC="../specifications"
8+
SCRIPT=".evergreen/resync-specs.sh"
99
BRANCH_NAME="spec-resync-"$(date '+%m-%d-%Y')
1010

1111
# List of directories to skip
@@ -49,9 +49,9 @@ for item in "$SPEC_DEST"/*; do
4949

5050
# Check that item is not a python file
5151
if [[ $item != *.py ]]; then
52-
53-
output=$(./$SCRIPT "$item_name" 2>&1)
54-
52+
echo " doing $item_name"
53+
# output=$(./$SCRIPT "$item_name" 2>&1)
54+
output=$($SCRIPT "$item_name")
5555
# Check if the script ran successfully
5656
if [[ $? -ne 0 ]]; then
5757
errored_specs+=("$item_name")
@@ -86,10 +86,11 @@ else
8686
fi
8787

8888
# Output the PR body (optional step for verification)
89+
echo "$pr_body"
8990
echo "$pr_body" >> spec_sync.txt
9091

9192
# call scrypt to create PR for us
92-
./create-pr.sh
93+
.evergreen/scripts/create-pr.sh spec_sync.txt
9394

9495
rm spec_sync.txt
9596
#git add $SPEC_DEST

0 commit comments

Comments
 (0)