trellis-sync icon indicating copy to clipboard operation
trellis-sync copied to clipboard

Use config from wp-cli.yml

Open strarsis opened this issue 8 years ago • 6 comments
trafficstars

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.

strarsis avatar May 11 '17 22:05 strarsis

What do you mean? I do not follow.. We do use an example wp-cli.yml (wp-cli.yaml earlier on).

jasperf avatar May 23 '17 16:05 jasperf

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?

strarsis avatar May 23 '17 16:05 strarsis

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 avatar May 24 '17 05:05 jasperf

@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.

strarsis avatar Jun 12 '17 20:06 strarsis

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 avatar Jun 13 '17 04:06 jasperf

@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.

strarsis avatar Jun 13 '17 12:06 strarsis