Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tag releases automatically #71

Merged
merged 1 commit into from
Jun 9, 2015
Merged
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
28 changes: 28 additions & 0 deletions pages_builder/tag_latest_version.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh
set -e
echo "≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡"
if [[ $(git log master --pretty=oneline --abbrev-commit --no-decorate | grep "Bump version to" | head -n1 | wc -l) -gt 0 ]]; then
echo "TAGGING LATEST VERSION"
echo "--------------------------------------------------------------------------------"
commit=$(git log master --pretty=oneline --abbrev-commit --no-decorate | grep "Bump version to" | head -n1)
commit_message_parts=($commit)
sha=${commit_message_parts[0]}
version=v$(cat VERSION.txt)
previous_version=$(git tag|tail -n1)
changes=$(git log --merges --oneline $previous_version..$version)
echo Commit:\ \ \ $commit
echo Version:\ \ $version
echo Previous:\ $previous_version
echo "================================================================================"
echo "CHANGES:"
echo $changes
echo "================================================================================"
git tag -a v$version -m "Release version $version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this missing a closing "?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, it's a multiline string. The whole message is:

"Release version $version

Includes:
$changes"


Includes:
$changes"
echo "New tag created!"
echo "--------------------------------------------------------------------------------"
else
echo "No version bump found"
fi