From 9b3d790e1383dca605e420c3b8e2876ea5433b5e Mon Sep 17 00:00:00 2001 From: Sophie Stadler Date: Tue, 5 Mar 2024 14:40:47 -0500 Subject: [PATCH] Prefix tags with parsley/ --- .yarnrc | 2 ++ scripts/deploy/utils/git/tag/constants.ts | 1 - scripts/deploy/utils/git/tag/tag-utils.ts | 5 ++--- scripts/push-version.sh | 19 ++++++++++++++++--- 4 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 .yarnrc delete mode 100644 scripts/deploy/utils/git/tag/constants.ts diff --git a/.yarnrc b/.yarnrc new file mode 100644 index 00000000..5ff4d19a --- /dev/null +++ b/.yarnrc @@ -0,0 +1,2 @@ +version-tag-prefix parsley/v +version-git-message "parsley/v%s" diff --git a/scripts/deploy/utils/git/tag/constants.ts b/scripts/deploy/utils/git/tag/constants.ts deleted file mode 100644 index e903a5c2..00000000 --- a/scripts/deploy/utils/git/tag/constants.ts +++ /dev/null @@ -1 +0,0 @@ -export const githubRemote = "https://github.com/evergreen-ci/parsley"; diff --git a/scripts/deploy/utils/git/tag/tag-utils.ts b/scripts/deploy/utils/git/tag/tag-utils.ts index 97d511ff..ada60f16 100644 --- a/scripts/deploy/utils/git/tag/tag-utils.ts +++ b/scripts/deploy/utils/git/tag/tag-utils.ts @@ -1,5 +1,4 @@ import { execSync } from "child_process"; -import { githubRemote } from "./constants"; /** * `createNewTag` is a helper function that creates a new tag. @@ -29,7 +28,7 @@ const getLatestTag = () => { * @param tag - the tag to delete */ const deleteTag = (tag: string) => { - const deleteCommand = `git push --delete ${githubRemote} ${tag}`; + const deleteCommand = `git push --delete upstream ${tag}`; execSync(deleteCommand, { stdio: "inherit", encoding: "utf-8" }); }; @@ -37,7 +36,7 @@ const deleteTag = (tag: string) => { * `pushTags` is a helper function that pushes tags to the remote. */ const pushTags = () => { - execSync(`git push --tags ${githubRemote}`, { + execSync(`git push --tags upstream`, { stdio: "inherit", encoding: "utf-8", }); diff --git a/scripts/push-version.sh b/scripts/push-version.sh index b82650b6..6df9035f 100755 --- a/scripts/push-version.sh +++ b/scripts/push-version.sh @@ -1,9 +1,16 @@ #!/bin/bash WAIT_TIME=9 -GITHUB_REMOTE=https://github.com/evergreen-ci/parsley +GIT_DESTINATION=$(git rev-parse --abbrev-ref @{upstream}) -git push $GITHUB_REMOTE + +if git push upstream +then + echo "Successfully pushed to ${GIT_DESTINATION}" +else + echo "Failed to push to ${GIT_DESTINATION}" + exit 1 +fi i=$WAIT_TIME while [ $i -gt 0 ] @@ -11,4 +18,10 @@ while [ $i -gt 0 ] done echo "" -git push --tags $GITHUB_REMOTE +if git push --tags upstream +then + echo "Successfully pushed tags to ${GIT_DESTINATION}" +else + echo "Failed to push tags to ${GIT_DESTINATION}" + exit 1 +fi