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

Staging and Live -> possible settings to restrict or disable via wordmove? #545

Closed kaktux closed 4 years ago

kaktux commented 5 years ago

hi,

this may not be entirely wordmove related - but as i am enjoying this tool a lot and just finished my first tests using wordmove via virtual machine (ubuntu netboot lts) to push my local wordpress to a staging and now think about going live some questions came into my mind. Maybe some of you can share how they handle this:

Local environment: i want to be able to do it all

Staging environment: for testing everything should be possible. But how do you handle staging sites when your done and pushed to live environment? Difference to live is:

So my question would be if its is somehow possible with wordmove to disable the staging site after your done testing (maybe via an extra environment that "breaks" some files).

Live environment: Your done testing your local page via pushing to staging -> and now pushed to live.

The "whole" reason i like wordmove is to make changes easily on your local machine and then push to live. Therefore live doesn't need the "risk" of having access to the backend/dashboard at all. So - Is it possible with wordmove to "break" the admin/dashboard access on the live site?

I read through the wiki but couldn't answer that after doing so - so maybe someone of you can share their experience or way of handling staging and live pages.

alessandro-fazzi commented 4 years ago

Hello @kaktux ,

I'll take one example to rule them all. In production I always want to be sure that search engine will index the site, as opposite to the staging server.

What I do:

wp option set blog_public 1

while my post-deploy hook for staging would be

wp option set blog_public 0

This is just an example that concern the use of Wordmove. For things relying on programmatic logic i always set an ENVIRONMENT constant in my wp-config.php; I obviously never move wp-config.php around, so it's manually compiled per-environment and it will remain unaltered. Then inside my code i can do logic on

if ('production' === ENVIRONMENT) {
    // actions
}

Hope it helps 😉

alessandro-fazzi commented 4 years ago

Oh, an idea to completely "disable" an installation could be

NAME

  wp maintenance-mode

DESCRIPTION

  Activates, deactivates or checks the status of the maintenance mode of a site.

SYNOPSIS

  wp maintenance-mode <command>

SUBCOMMANDS

  activate        Activates maintenance mode.
  deactivate      Deactivates maintenance mode.
  is-active       Detects maintenance mode status.
  status          Displays maintenance mode status.
alessandro-fazzi commented 4 years ago

Feedbacks?

alessandro-fazzi commented 4 years ago

Stalled