Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
DEVPROD-5132: Make tags unique (#2282)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophstad authored Mar 4, 2024
1 parent c783b5a commit 202cb82
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 2 additions & 0 deletions .yarnrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version-tag-prefix spruce/v
version-git-message "spruce/v%s"
1 change: 0 additions & 1 deletion scripts/deploy/utils/git/tag/constants.ts

This file was deleted.

5 changes: 2 additions & 3 deletions scripts/deploy/utils/git/tag/tag-utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { execSync } from "child_process";
import { githubRemote } from "./constants";
import { green, underline } from "../../../../utils/colors";

/**
Expand Down Expand Up @@ -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) {
Expand All @@ -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",
});
Expand Down
14 changes: 7 additions & 7 deletions scripts/push-version.sh
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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

0 comments on commit 202cb82

Please sign in to comment.