Last active
July 28, 2016 18:48
-
-
Save jepster/2f05b78d47cd0b954a5191f90562d250 to your computer and use it in GitHub Desktop.
Phing Target for Website Sync
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
<target name="syncWebsiteToLive" | |
description="Sync folder and files via Rsync to live server."> | |
<echo msg="Syncing data to live server." /> | |
<exec command="rsync -a --progress --delete /home/peter/Websites/example.com/ --exclude=.git/ --exclude=.idea/ --exclude=sites/default/settings.php user@example.com:/var/www/example.com/" | |
passthru="true" | |
checkreturn="true" /> | |
<echo msg="Delete old database" /> | |
<exec command="ssh example.com 'mysql -uroot -pPASSWORD -e "drop database example_com;"'" | |
passthru="true" | |
checkreturn="true" /> | |
<echo msg="Create new empty database" /> | |
<exec command="ssh example.com 'mysql -uroot -pPASSWORD -e "create database example_com;"'" | |
passthru="true" | |
checkreturn="true" /> | |
<echo msg="Import database dump" /> | |
<exec command="ssh example.com 'mysql -uroot -pPASSWORD example_com < /var/www/example.com/db_dumps/latest.sql'" | |
passthru="true" | |
checkreturn="true" /> | |
</target> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment