Created
April 26, 2014 17:15
-
-
Save flomotlik/11325585 to your computer and use it in GitHub Desktop.
Check for branch name with Regex
This file contains 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 | |
echo $COMMIT_BRANCH | grep -E "^(\d\.?)+$" > /dev/null | |
match_result=$? | |
if [ "$match_result" -eq "0" ] | |
then | |
# Exit if any command fails only when the deployment runs | |
set -e | |
echo MATCH | |
# Run commands if match | |
else | |
echo No Match | |
# Add message that there was no match | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment