Last active
December 30, 2015 05:19
-
-
Save jonathanbardo/7782311 to your computer and use it in GitHub Desktop.
WP-CLI SSH
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
# Querying vagrant | |
$ cd ~/Sites/vvv/www/example.com/ | |
$ vagrant ssh | |
$ cd /www/example.com/ | |
$ wp plugin status | |
$ exit; | |
# Querying staging server | |
$ ssh [email protected] | |
$ cd /www/example.com/ | |
$ wp plugin status | |
$ exit; |
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
ssh: | |
vagrant: | |
# The %pseudotty% placeholder gets replaced with -t or -T depending on whether you're piping output | |
# The %cmd% placeholder is replaced with the originally-invoked WP-CLI command | |
cmd: vagrant ssh-config > /tmp/vagrant_ssh_config && ssh -q %pseudotty% -F /tmp/vagrant_ssh_config default %cmd% | |
# Passed to WP-CLI on the remote server via --url | |
url: local-www.yourawesomewebsite.com | |
# We cd to this path on the remote server before running WP-CLI | |
path: /your/vvv/path/ | |
staging: | |
cmd: ssh %pseudotty% util.example.com %cmd% | |
url: staging.example.com | |
path: /var/www/staging.example.com/current/docroot | |
# WP-CLI over SSH will stop if one of these are provided | |
disabled_commands: | |
- db drop | |
- db reset | |
- plugin install | |
- core multisite-convert |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment