welaika / wordmove

Multi-stage command line deploy/mirroring and task runner for Wordpress
https://wptools.it/wordmove
MIT License
1.87k stars 165 forks source link

I want to deactivate plugin when push -e production #455

Closed byron222 closed 6 years ago

byron222 commented 6 years ago

I want to deactivate plugin when push -e production.

there's plugin that i only use in staging, but in production i dont need.

so, would be great if there any way to deactivate when i push to my production.

so, when is run wordmove push -e production --all or wordmove push -e production -p i want an option that can set which plugin active and which deactivate.

alessandro-fazzi commented 6 years ago

Do you have wp-cli installed in production?

byron222 commented 6 years ago

yes!

alessandro-fazzi commented 6 years ago

Sorry @byron222 for my delay. Busy days.

What I'd do to accomplish your need is to use Wordmove's hooks. An example is here, but you'll need some differentiations:

production:
  <% prod_wp_path = "/home/sshwordmove/sshwordmove.welaika.com" %>
  vhost: "http://sshwordmove.welaika.com"
  wordpress_path: <%= prod_wp_path %> # use an absolute path here

  database:
    [...]

  exclude:
    [...]

  ssh:
    [...]

  hooks:
    push:
      after:
        remote:
          - 'cd <%= prod_wp_path %> && wp plugin deactivate debug-bar'

Obviously debug-bar will be the slug of your very plugin which has to be deactivated :)

Let me know

byron222 commented 6 years ago

Thank you very much!!!

alessandro-fazzi commented 6 years ago

Nice! You are welcome 😊