-
-
Notifications
You must be signed in to change notification settings - Fork 14
Upload latest schema on startup? #153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @NilsBaumgartner1994 npx directus-sync wait --interval 5 --timeout 60 && npx directus-sync push Could this help for your use case ? |
I thought about a custom api hook which would start during the init server start hook. |
@EdouardDem i created in directus a feature request: directus/directus#24647 But is it possible for directus-sync to somehow be called before directus even starts? Like passing a path to the extension, where to find the latest schema? |
If you're using docker compose you can deploy directus-sync as a separate container and make other services depend on it so they start only when configuration is uploaded. Here's my setup: services:
directus:
depends_on:
database:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://directus:8055/server/health"]
directus-sync:
environment:
DIRECTUS_URL: http://directus:8055
DIRECTUS_ADMIN_EMAIL: ${DIRECTUS_ADMIN_EMAIL}
DIRECTUS_ADMIN_PASSWORD: ${DIRECTUS_ADMIN_PASSWORD}
depends_on:
directus:
condition: service_healthy
app:
depends_on:
directus-sync:
condition: service_completed_successfully
FROM node:23-slim
RUN npm install --global directus-sync
WORKDIR /app
# You can mount a volume instead for development deploys
COPY ./configuration/directus /app/configuration/directus/
CMD ["npx", "directus-sync", "push", "--dump-path", "./configuration/directus"] |
Yes awesome that’s something that could work. |
Is your feature request related to a problem? Please describe.
I would like to always upload the latest schema when i am about to start my remote servers.
Describe the solution you'd like
A small folder where it uses it to automatically push the schema from.
Describe alternatives you've considered
A script which waits for directus to boot up and then to upload the schema.
Additional context
Great work of your project. Realy hope to see it come directly from directus.
The text was updated successfully, but these errors were encountered: