Last active
February 15, 2019 23:56
-
-
Save aryelgois/7160eb5eac527c9b9e75aad033d17ccb to your computer and use it in GitHub Desktop.
Automated creation of major and minor releases
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Automated creation of major and minor releases | |
# | |
# Usage: release VERSION | |
# | |
# VERSION should be a semver for the next release | |
# | |
# For patch releases (i.e. hotfixes) you need to | |
# do manually | |
# | |
# Environment variables: | |
# REMOTE Remote to push the new release branch | |
# DEVELOP Branch with features for the release | |
# STAGING Branch for staging purposes | |
set -e | |
REMOTE=${REMOTE:-origin} | |
DEVELOP=${DEVELOP:-develop} | |
STAGING=${STAGING:-homologacao} | |
RELEASE="release/$1" | |
echo "Updating staging branch..." | |
git checkout "$STAGING" | |
git pull | |
echo | |
echo "Merging develop branch..." | |
git merge "$REMOTE/$DEVELOP" --no-ff -m "Prepare release $1" | |
git push | |
echo | |
echo "Creating release branch..." | |
git checkout -b "$RELEASE" | |
git push -u "$REMOTE" "$RELEASE" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Install
Copy the file to a directory in your
$PATH
, rename torelease
and add the executable bit