trellis-sync
trellis-sync copied to clipboard
Use config from wp-cli.yml
The wp cli aliases are already defined in wp-cli.yml - it would reduce the amount of config and the necessity keeping it in sync when trellis-sync also uses the config in wp-cli.yml.
What do you mean? I do not follow.. We do use an example wp-cli.yml (wp-cli.yaml earlier on).
Wouldn't it be better if the configuration would be moved from sync-all.sh to a separate yaml file? Or the domain + uploads/ directory field either determined automatically using wp cli?
Well, it would be cleaner to have:
DEVDIR="web/app/uploads/"
DEVSITE="https://example.dev"
PRODDIR="[email protected]:/srv/www/example.com/shared/uploads/"
PRODSITE="https://example.com"
STAGDIR="[email protected]:/srv/www/example.com/shared/uploads/"
STAGSITE="https://staging.example.com"
loaded from the wp-cli.yml file. Perhaps similar to what we have at sync-db-from-prod.sh and sync-db-from-dev.sh. An option would be to turn sync-db-from-prod.sh into synch-em-all.sh and add and if else with to and from production. But then we would need to include rsync -az --progress "$FROMDIR" "$TODIR" still. We could keep rsynch, but if we want to replace the shell variables for the directories I am not sure how we could do that using wp-cli.yml or a separate yml file.
@jasperf: Ideally the script can be installed globally and be used with different WordPress sites, using the wp-cli.yml file with the extra options.
Well, that is something that sounds like a conversion of this package to a composer package you could install globally. Never did that before. Made a basic composer.json just now. Feel free to check it and or send in PRs for improvement.
@jasperf: It would be great if the commits in this repository are semver-tagged, then I can also specify a version for this tool in composer.