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 70707 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: 5647
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


-----------------------
Webuzo - Multi User Hosting Control Panel
AMPPS - Best WordPress/PHP/MySQL development tool
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 April 18, 2024, 6:58 pm.

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