valentinocossar / trellis-database-uploads-migration

Ansible playbook for Trellis that manages database and uploads migration.
MIT License
94 stars 13 forks source link

Manage multiple distant sites, but a single one for development #18

Open zessx opened 6 years ago

zessx commented 6 years ago

In a lot of situations, you'll have a staging and a production website on the same server.
Trellis only supports this by using multiple keys in your wordpress_sites (@see https://discourse.roots.io/t/staging-and-production-on-same-vps/2440/23), so you'll end with 2 environments:

# groups_vars/development/wordpress_sites.yml
wordpress_sites:
  domain.tld: ...
# groups_vars/production/wordpress_sites.yml
wordpress_sites:
  domain.tld: ...
  staging.domain.tld: ...

Working like this makes it impossible to push/pull from and to the staging site, as our development environment does NOT have the staging.domain.tld.

We already are able to target the distant couple env + site, but we should also be able to target the local site, to makes these migration possibles:

As this behavior is not the default one, I suggest to make this local-targeting thing optional:

What are your thoughts on this feature?
As we need it for our servers, we maybe will work on it in the next weeks, but any help would be greatly welcomed!