Last active
May 18, 2017 10:21
-
-
Save ekandreas/b412df9d35407e0deb5ae02f35c4d90e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
/** | |
* Deployer pull task for reversed deployment of WordPress Bedrock | |
* PHP Deployer v5 | |
*/ | |
task('pull', function () { | |
$host = Context::get()->getHost(); | |
$user = $host->getUser(); | |
$hostname = $host->getHostname(); | |
$localHostname = str_replace('.se', '.app', $hostname); | |
$actions = [ | |
"ssh {$user}@{$hostname} 'cd {{deploy_path}}/current && wp db export - --allow-root | gzip' > db.sql.gz", | |
"gzip -df db.sql.gz", | |
"wp db import db.sql", | |
"rm -f db.sql", | |
"wp search-replace 'www.{$hostname}' '{$localHostname}'", | |
"wp search-replace '{$hostname}' '{$localHostname}'", | |
"wp search-replace 'https://{$localHostname}' 'http://{$localHostname}'", | |
"rsync --exclude .cache -rve ssh " . | |
"{$user}@{$hostname}:{{deploy_path}}/shared/web/app/uploads web/app", | |
"wp plugin deactivate varnish-http-purge", | |
"wp plugin deactivate elasticpress", | |
"wp plugin activate query-monitor", | |
"wp rewrite flush", | |
"wp cache flush" | |
]; | |
foreach ($actions as $action) { | |
writeln("{$action}"); | |
writeln(runLocally($action)); | |
} | |
}); |
Typo cache flush fixed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updated for Deployer v5 and with agnostic hosts settings