Created
March 18, 2019 11:32
-
-
Save MiquelAdell/cb07691e38f6d06b4d1d555761a75721 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# drop the database | |
# this step relies on having a WP CLI installed and configured but one could | |
# use any other method to get the database | |
wp @dev db export --add-drop-table dev_database.sql | |
(cd htdocs/wp-content/themes/project-name; yarn build:production) | |
(cd htdocs/wp-content/; rm debug.log) | |
# copy all wp-content content except node modules and cvs related stuff. Please | |
# note that some content may fall to copy due to excludes | |
rsync -aphvP --update --delete --cvs-exclude --exclude node_modules/ ~/code/VVV/www/project-name/htdocs/wp-content user@destination-host:/srv/users/user/apps/clients-project-name/public/ | |
# copy the wpml translation management plugin without excludes because there are | |
# some files being excluded that should not be | |
rsync -aphvP --update --delete ~/code/VVV/www/project-name/htdocs/wp-content/plugins/wpml-translation-management user@destination-host:/srv/users/user/apps/clients-project-name/public/wp-content/plugins/ | |
# copy the database | |
rsync -aphvP --update --delete ~/code/VVV/www/project-name/htdocs/dev_database.sql user@destination-host:/srv/users/user/apps/clients-project-name/public/dev_database.sql | |
wp @staging db import dev_database.sql | |
wp @staging search-replace "project-name.test" "project-name.com" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment