-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Preview in a different module path (#474)
Co-authored-by: Wojciech Trocki <w.trocki@mongodb.com>
- Loading branch information
Showing
6 changed files
with
40 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
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
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,23 @@ | ||
#!/bin/bash | ||
set -ueo pipefail | ||
|
||
script_path=$(dirname "$0") | ||
# shellcheck source=/dev/null | ||
source "$script_path/extract-version.sh" | ||
# shellcheck source=/dev/null | ||
source "$script_path/version-paths.sh" | ||
|
||
OLD_PACKAGE="go.mongodb.org/atlas-sdk/${SDK_MAJOR_VERSION}" | ||
NEW_PACKAGE="github.com/mongodb/atlas-sdk-go" | ||
examples_path="$script_path/../../../examples" | ||
|
||
echo "Delete specific version $SDK_MAJOR_VERSION from examples go.mod" | ||
(cd "$examples_path" && go mod edit -droprequire="$OLD_PACKAGE") | ||
|
||
echo "Modifying all instances from $OLD_PACKAGE to $NEW_PACKAGE across the repository." | ||
npm install | ||
npm exec -c "replace-in-file '/$OLD_PACKAGE/g' '$NEW_PACKAGE' $VERSION_UPDATE_PATHS_PREVIEW --isRegex" | ||
|
||
echo "Add preview version to examples go.mod" | ||
(cd "$examples_path" && go get $NEW_PACKAGE) | ||
|
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
#!/bin/bash | ||
|
||
export VERSION_UPDATE_PATHS="../**/go.mod,../**/*.go,../tools/**/*.mustache,../.mockery.yaml,../**/*.md" | ||
|
||
# don't change doc files to reduce Preview PR noise | ||
export VERSION_UPDATE_PATHS_PREVIEW="../**/go.mod,../**/*.go,../tools/**/*.mustache,../.mockery.yaml" |