xwp / wp-cli-ssh

[OBSOLETE] Seamlessly run WP-CLI commands on a remote server via SSH
157 stars 14 forks source link

wp-cli-ssh not working with Roots.io Trellis & Bedrock #24

Open jastuccio opened 8 years ago

jastuccio commented 8 years ago

I am unable to get wp-cli-ssh working with Roots.io Trellis & Bedrock. I can use vagrant ssh to access the command line in the box. wp ssh plugin status --host=vagrant returns the error ssh: connect to host 192.168.50.10 port 22: Operation timed out.

I installed wp-cli-ssh globally with composer and it is also required in my composer.json file. This is my wp-cli.local.yml http://pastebin.com/i9NMXHGE

The path is path: web/wp which is standard for Bedrock. I get errors if I change it to docroot

retlehs commented 8 years ago

been wanting to try out this project and got it working with @roots:

path: web/wp

ssh:
  vagrant:
    cmd: cd ../trellis && vagrant ssh-config > /tmp/vagrant_ssh_config && ssh -q %pseudotty% -F /tmp/vagrant_ssh_config default %cmd%
    path: /srv/www/example.com/current/web

  production:
    cmd: ssh %pseudotty% web@example.com %cmd%
    url: example.com
    path: /srv/www/example.com/current/web
    disabled_commands:
      - db drop
      - db reset
      - plugin install
      - core multisite-convert

i haven't found a way of getting this to properly run without passing a full path to wp-cli-ssh.php. examples:

wp ssh plugin status --host=production --require=/Users/ben/Sites/roots/site/vendor/x-team/wp-cli-ssh/wp-cli-ssh.php
wp ssh plugin status --host=vagrant --require=/Users/ben/Sites/roots/site/vendor/x-team/wp-cli-ssh/wp-cli-ssh.php

i tried adding require: vendor/x-team/wp-cli-ssh/wp-cli-ssh.php to wp-cli.yml but that resulted in:

PHP Fatal error:  Cannot redeclare class WP_CLI_SSH_Command in /srv/www/example.com/current/vendor/x-team/wp-cli-ssh/wp-cli-ssh.php on line 216
jastuccio commented 8 years ago

Thanks for replying Ben. I will refer to this post when I get back to looking at that site.

kenng commented 8 years ago

Have run:

    cd  [web-folder]  
    composer require x-team/wp-cli-ssh dev-master  
    wp plugin activate "JQuery Ui"  

Then I have this error when running Fatal error: Cannot redeclare class Spyc in [web-folder]/vendor/mustangostang/spyc/Spyc.php on line 57

the wp-cli.yml is placed in [web-folder] less wp-cli.yml shows path: web/wp

Have not really use wp cli before, let me know if i use the command wrongly. Thanks.