git-secret/utils/post-commit.sh
mail@sobolevn.me 874a4468d7 release
2016-03-13 13:27:36 +03:00

19 lines
475 B
Bash
Executable File

#!/usr/bin/env bash
set -e
BRANCH_NAME=$(git branch | grep '*' | sed 's/* //')
if [[ "$BRANCH_NAME" == 'master' ]]; then
# Build new web documentation:
make build-gh-pages
fi
if [[ "$BRANCH_NAME" == 'develop' ]]; then
# create new release:
NEWEST_TAG=$(git describe --abbrev=0 --tags)
SCRIPT_VERSION=$(bash ${PWD}/git-secret --version)
if [[ "$NEWEST_TAG" != "v${SCRIPT_VERSION}" ]]; then
git tag -a "v${SCRIPT_VERSION}" -m "version $SCRIPT_VERSION"
fi