Closed HDDTHR closed 1 month ago
I wonder why this is necessary. I do install schema-sync
in a deployment scenario too. Your CI/CD pipeline can deploy the files and npm ci
, npx directus bootstrap --skipAdminInit
and finally npx directus schema-sync install
followed by npx directus schema-sync import
.
If this is part of your deployment, you don't even need the SCHEMA_SYNC
env variable and personally I would even refrain from using it. Being explicit about imports and exports gives me peace, knowing that only my own automation can break things, not someone else's.
@martin-braun Honestly, my primary focus was on deploying my setup with docker compose, as it's what I use most of the time for CI, but your suggestion is logical. I envisioned that the developer would set things up similar to the example repository above, but if they use some other CI solution, it would work even better.
I think I'll be closing this pull request <3
As of right now, anyone wanting to setup directus-schema-sync will have to install it using npx, then restart it to set the
SCHEMA_SYNC
environment variable to start syncing.I propose that a
SCHEMA_SYNC_AUTO_INSTALL
environment variable be added to automatically install the extension.I created an example github repository demonstrating how this could be used.