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 (#500)
Browse files Browse the repository at this point in the history
  • Loading branch information
sophstad authored Mar 5, 2024
1 parent 9aea5bd commit ac7c735
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 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 parsley/v
version-git-message "parsley/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";

/**
* `createNewTag` is a helper function that creates a new tag.
Expand Down Expand Up @@ -29,15 +28,15 @@ 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" });
};

/**
* `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",
});
Expand Down
19 changes: 16 additions & 3 deletions scripts/push-version.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,27 @@
#!/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 ]
do echo -en "Waiting ${i}s for Evergreen to pick up the version\r"; sleep 1; i=$((i-1))
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

0 comments on commit ac7c735

Please sign in to comment.