Skip to content

Instantly share code, notes, and snippets.

@wings27
Last active November 11, 2016 06:14
Show Gist options
  • Save wings27/d6f62388a5469782e557c2a15cdb3ce7 to your computer and use it in GitHub Desktop.
Save wings27/d6f62388a5469782e557c2a15cdb3ce7 to your computer and use it in GitHub Desktop.
execute DB_xxx.sql from git.
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
@wings27
Copy link
Author

wings27 commented Nov 11, 2016

execute DB_xxx.sql from git.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment