Last active
July 27, 2017 17:06
-
-
Save jmlagace/3206fbfdb8b09fe0876c53280ffe2459 to your computer and use it in GitHub Desktop.
Autotagging on git
This file contains hidden or 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
#!/bin/bash | |
TARGET_PREFIX=${1:-release} | |
TARGET_BASE=$TARGET_PREFIX-`date +%Y%m%d` | |
TARGET_REVISION=$((`git ls-remote --heads origin | awk "/$TARGET_BASE-(.*)/ { print $1 }" | awk -F'-' '{print $3}' | sort -nr | head -n 1` + 1)) | |
TARGET_BRANCH=$TARGET_BASE-$TARGET_REVISION | |
git checkout -b $TARGET_BRANCH | |
git push origin $TARGET_BRANCH | |
echo "tagging complete under branch $TARGET_BRANCH" | |
This file contains hidden or 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
#!/bin/bash | |
TARGET_PREFIX=${1:-release} | |
TARGET_BASE=$TARGET_PREFIX-`date +%Y%m%d` | |
TARGET_REVISION=$((`git ls-remote --tags --heads origin | awk "/$TARGET_BASE-(.*)/ { print $1 }" | awk -F'-' '{print $3}' | sort -nr | head -n 1` + 1)) | |
TARGET_BRANCH=$TARGET_BASE-$TARGET_REVISION | |
git tag $TARGET_BRANCH | |
git push origin $TARGET_BRANCH | |
echo "tagging complete under tag $TARGET_BRANCH" |
This file contains hidden or 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
#!/bin/bash | |
[[ "$1" = "recent" ]] && ADDITONAL_OPTIONS="-mmin -240" | |
find . $ADDITONAL_OPTIONS -name "*.php" -print0 | xargs -0 -n1 -P10 php -l | grep -v 'No syntax errors' | |
if [ "$?" -eq "0" ]; then | |
exit 1 | |
else | |
exit 0 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment