From 202cb8265d790e6b5e52515407bd301a28ecdaf2 Mon Sep 17 00:00:00 2001 From: Sophie Stadler Date: Mon, 4 Mar 2024 10:11:59 -0500 Subject: [PATCH] DEVPROD-5132: Make tags unique (#2282) --- .yarnrc | 2 ++ scripts/deploy/utils/git/tag/constants.ts | 1 - scripts/deploy/utils/git/tag/tag-utils.ts | 5 ++--- scripts/push-version.sh | 14 +++++++------- 4 files changed, 11 insertions(+), 11 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 0000000000..7633e78754 --- /dev/null +++ b/.yarnrc @@ -0,0 +1,2 @@ +version-tag-prefix spruce/v +version-git-message "spruce/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 5241928a40..0000000000 --- a/scripts/deploy/utils/git/tag/constants.ts +++ /dev/null @@ -1 +0,0 @@ -export const githubRemote = "https://github.com/evergreen-ci/spruce"; diff --git a/scripts/deploy/utils/git/tag/tag-utils.ts b/scripts/deploy/utils/git/tag/tag-utils.ts index 3fc2efe3db..026b22933a 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"; import { green, underline } from "../../../../utils/colors"; /** @@ -49,7 +48,7 @@ const getLatestTag = () => { */ const deleteTag = (tag: string) => { console.log(`Deleting tag (${tag}) from remote...`); - const deleteCommand = `git push --delete ${githubRemote} ${tag}`; + const deleteCommand = `git push --delete upstream ${tag}`; try { execSync(deleteCommand, { stdio: "inherit", encoding: "utf-8" }); } catch (err) { @@ -63,7 +62,7 @@ const deleteTag = (tag: string) => { const pushTags = () => { console.log("Pushing tags..."); try { - 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 024bac9958..79126cf6b9 100755 --- a/scripts/push-version.sh +++ b/scripts/push-version.sh @@ -1,13 +1,13 @@ #!/bin/bash WAIT_TIME=9 -GITHUB_REMOTE=https://github.com/evergreen-ci/spruce +GIT_DESTINATION=$(git rev-parse --abbrev-ref @{upstream}) -if git push $GITHUB_REMOTE +if git push upstream then - echo "Successfully pushed to ${GITHUB_REMOTE}" + echo "Successfully pushed to ${GIT_DESTINATION}" else - echo "Failed to push to ${GITHUB_REMOTE}" + echo "Failed to push to ${GIT_DESTINATION}" exit 1 fi @@ -17,11 +17,11 @@ while [ $i -gt 0 ] done echo "" -if git push --tags $GITHUB_REMOTE +if git push --tags upstream then - echo "Successfully pushed tags to ${GITHUB_REMOTE}" + echo "Successfully pushed tags to ${GIT_DESTINATION}" else - echo "Failed to push tags to ${GITHUB_REMOTE}" + echo "Failed to push tags to ${GIT_DESTINATION}" exit 1 fi