sqlmap/extra/shutils/postcommit-hook

22 lines
626 B
Plaintext
Raw Normal View History

2016-03-17 19:06:11 +03:00
#!/bin/bash
SETTINGS="../../lib/core/settings.py"
declare -x SCRIPTPATH="${0}"
FULLPATH=${SCRIPTPATH%/*}/$SETTINGS
if [ -f $FULLPATH ]
then
LINE=$(grep -o ${FULLPATH} -e 'VERSION = "[0-9.]*"');
declare -a LINE;
NEW_TAG=$(python -c "import re, sys, time; version = re.search('\"([0-9.]*)\"', sys.argv[1]).group(1); _ = version.split('.'); print '.'.join(_[:-1]) if len(_) == 4 and _[-1] == '0' else ''" "$LINE")
if [ -n "$NEW_TAG" ]
then
2016-04-04 13:34:19 +03:00
git commit -am "Automatic monthly tagging"
2016-03-17 19:06:11 +03:00
echo "Creating new tag ${NEW_TAG}";
git tag $NEW_TAG;
2016-04-04 13:34:19 +03:00
git push origin $NEW_TAG
2016-03-17 19:06:11 +03:00
fi
fi;