Skip to content

Commit

Permalink
add comments and update logic
Browse files Browse the repository at this point in the history
  • Loading branch information
juliodialpad committed Jan 22, 2024
1 parent e1735e1 commit ab0e6a2
Showing 1 changed file with 25 additions and 5 deletions.
30 changes: 25 additions & 5 deletions scripts/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,30 @@ release_branch="${1:-production}"
if [[ "$release_branch" == "production" && "$current_branch" != "staging" ]]; then
echo "Releasing production can only be done while on staging branch"
exit 1;
else
echo "Deleting local and remote $release_branch branch"
git branch -d "$release_branch"
git push origin --delete "$release_branch"
fi

git pull &&
pnpm nx affected --target=release-local --parallel=false &&
git checkout "$release_branch" &&
git merge --ff-only "$current_branch" &&
git push -u origin "$release_branch"
echo "Updating branch"
git pull;

echo "Running release-local on affected projects"
pnpm nx affected --target=release-local --parallel=false;

echo "Checking out to $release_branch"
if [[ "$release_branch" == "alpha" || "$release_branch" == "beta" ]]; then
git checkout -b "$release_branch";
else
git checkout "$release_branch";

echo "Updating branch"
git pull;

echo "Merging changes"
git merge --ff-only "$current_branch";
fi

echo "Pushing changes to $release_branch"
git push -u origin "$release_branch";

0 comments on commit ab0e6a2

Please sign in to comment.