Last active
November 11, 2016 06:14
-
-
Save wings27/d6f62388a5469782e557c2a15cdb3ce7 to your computer and use it in GitHub Desktop.
execute DB_xxx.sql from git.
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
MYSQL_HOST=10.17.1.153 | |
git checkout develop | |
git pull --verbose --all | |
SQL_DIFF=`git diff --name-only develop..release/latest | grep \.sql$` | |
if [[ $(echo $SQL_DIFF | grep -c ".sql") -ne 0 ]]; then | |
echo "Executing:" | |
echo $SQL_DIFF | |
echo | |
echo $SQL_DIFF | while read a; do mysql -h$MYSQL_HOST -uroot -p1 $(echo $a | cut -d'_' -f 1) < "$(echo $a)" ; done | |
fi | |
git checkout release/latest | |
git merge develop | |
git push --verbose --all | |
git checkout develop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
execute DB_xxx.sql from git.