Skip to content

Commit

Permalink
Avoid bashisms, duplicate 'v's
Browse files Browse the repository at this point in the history
  • Loading branch information
quis committed Jun 9, 2015
1 parent c06f41f commit e68e66e
Showing 1 changed file with 17 additions and 22 deletions.
39 changes: 17 additions & 22 deletions pages_builder/tag_latest_version.sh
@@ -1,28 +1,23 @@
#!/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
echo "TAGGING LATEST VERSION"
echo "--------------------------------------------------------------------------------"
commit=$(git log master --pretty=oneline --abbrev-commit --no-decorate | grep "Bump version to" | head -n1)
sha=$(echo $commit | cut -d ' ' -f1)
version=v$(cat VERSION.txt)
previous_version=$(git tag|tail -n1)
changes=$(git log --merges --oneline $previous_version..$sha)
echo Commit:\ \ \ $commit
echo Version:\ \ $version
echo Previous:\ $previous_version
echo "================================================================================"
echo "CHANGES:"
echo $changes
echo "================================================================================"
git tag -a $version -m "Release version $version
Includes:
$changes"
echo "New tag created!"
echo "--------------------------------------------------------------------------------"
else
echo "No version bump found"
fi
echo "New tag created!"
echo "--------------------------------------------------------------------------------"

0 comments on commit e68e66e

Please sign in to comment.