Created
June 22, 2017 13:52
-
-
Save JGrubb/0eb923c114679ca72e6e34a751dec440 to your computer and use it in GitHub Desktop.
Deploy hook for multisite WP (call from deploy hook)
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 | |
OLDURL='YOURSITE.COM' | |
NEWURL=$(echo $PLATFORM_ROUTES | base64 --decode | awk -F'"' '{print $2}' | awk -F"/" '{print $3}') | |
if [[ $PLATFORM_BRANCH != "master" ]]; then | |
php wp-cli search-replace $OLDURL $NEWURL 'wp_*options' wp_blogs wp_usermeta wp_site wp_sitemeta --skip-columns=guid | |
else | |
echo "This is the master branch, skipping URL replace." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment