-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
incidentSomething isn't workingSomething isn't working
Description
Describe the Bug
I was able to create a CICD flow to update my local schema an data to my remote instance when I push to my repo, however each time I modify the local data in a specific collection, all data in my remote instance is reset to my local instance data state deleting all the other items in the collection in my remote instance.
To Reproduce
I have a local directus instance (Installed Via NPM) and PostgreSQL. I do all my local work with this instance when I want to deploy I have the following file in my repo.
My Dockerfile
FROM directus/directus:11.2.1
USER root
RUN corepack enable
// Workaround to be able to install extensions with 'node' user, only required in v11.1.1
RUN rm node_modules/.modules.yaml
RUN pnpm install [email protected]
WORKDIR /directus
COPY ./schema-sync ./schema-sync
My docker-compose file
version: "8"
services:
directus-app:
build:
context: .
dockerfile: ./Dockerfile
image: directus-app:1.0.6
volumes:
- ./schema-sync:/directus/schema-sync
- ./extensions:/directus/extensions
command: >
sh -c "
npx directus schema-sync import --merge
"
Directus Version
v11.2.1
Hosting Strategy
Self-Hosted (Docker Image)
Database
PostgreSQL
- Export local DB with "npx directus schema-sync export"
- Perform an initial Commit and Push to repo
- CICD builds the image and pushes to server, on startup runs "npx directus schema-sync import --merge" app is deployed all is good
- Add a new item in remote instance to a collection you have marked for sync in "directus-app/schema-sync/directus_config.js"
- Update or Add an Item in any collection via the directus interphase on the local instance, make sure its in a collection you have marked for sync in "directus-app/schema-sync/directus_config.js"
- Run "npx directus schema-sync export" on local instance to sync changes
- Commit and push to repo
- CICD builds the image and pushes to server, on startup runs "npx directus schema-sync import --merge" this deletes all items in collection in remote instance and resets collection to local state
Version
3.0.2
Installed Extension Via
Docker file
Metadata
Metadata
Assignees
Labels
incidentSomething isn't workingSomething isn't working