Welcome Guest. Please Login or Register  


You are here: Index > Softaculous Auto Installer > General Support > Topic : Is it possible to automatically run some wp-cli commands after staging



Threaded Mode | Print  

 Is it possible to automatically run some wp-cli commands after staging (2 Replies, Read 59849 times)
ratcliffe_mike
Group: Member
Post Group: Newbie
Posts: 2
Status:
Is it possible to automatically run some wp-cli commands after staging. This would make your Wordpress staging even more useful.
This is my ideal workflow:
  1. Click "Create Staging" button.
  2. The staging instance is created and then two wp_cli commands are automatically run: i) wp plugin deactivate plugin1 plugin2 ii) wp db query "SQL query to update plugin keys"
  3. Make changes on staging instance.
  4. Click "Push to live"
  5. The staging instance is piushed to live and then two wp_cli commands are automatically run: i) wp plugin activate plugin1 plugin2 ii) wp db query "SQL query to update plugin keys"
IP: --   

Is it possible to automatically run some wp-cli commands after staging
Brijesh
Group: Softaculous Team
Post Group: Super Member
Posts: 5072
Status:
Hi,

Sorry for the delay in response.

Yes this is possible but you will need root access to the server to configure this.

You can do the above steps by using filters in Softaculous. Filters are PHP files which you can configure to execute your PHP function when a particular task is done in Softaculous. You can also execute shell commands using shell_exec or exec functions.

You can use the post_staging filter to execute code after staging is done :
https://www.softaculous.com/docs/developers/filters/#post_staging

You can use the post_pushtolive filter to execute code after push to live is done :
https://www.softaculous.com/docs/developers/filters/#post_pushtolive


-----------------------
Loginizer - WordPress Security Plugin
Follow us on Twitter
IP: --   

Is it possible to automatically run some wp-cli commands after staging
ratcliffe_mike
Group: Member
Post Group: Newbie
Posts: 2
Status:
Perfect, that looks like exactly what I need... thanks!
IP: --   

« Previous    Next »

Threaded Mode | Print  



Jump To :


Users viewing this topic
1 guests, 0 users.


All times are GMT. The time now is October 24, 2021, 9:07 am.

  Powered By AEF 1.0.8 © 2007-2008 Electron Inc.Queries: 11  |  Page Created In:5.195