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

DEVPROD-5132: Make tags unique #500

Merged
merged 1 commit into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading