feat(backend): directus data per project (#375)

* seed directus data as a whole per project, fix marker icon: user-outline

* rename deploy.sh back to seed.sh

* workflow to test the seed in the backend

* test workflow failure

* wait 3 seconds for all docker containers to be ready

* sleep 3 seconds not 3000

* mod permissions

* try sudo

* revert breaking change

* enforce exit status 0

* fix exit enforce

* test if failing seed files is related to the data folder

fix

* revert volume removal, create uploads folder

* also chmod
This commit is contained in:
Ulf Gebhardt 2025-09-08 21:22:50 +01:00 committed by GitHub
parent a49590243a
commit f8bf861e4e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
449 changed files with 80 additions and 11 deletions

54
.github/workflows/test.backend.seed.yml vendored Normal file
View File

@ -0,0 +1,54 @@
name: "test:build test docker"
on: push
jobs:
files-changed:
name: Detect File Changes - build - docker
runs-on: ubuntu-latest
outputs:
changes: ${{ steps.filter.outputs.match }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.1.7
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: filter
with:
filters: |
match:
- '.github/workflows/*'
- 'backend/**/*'
backend-seed:
if: needs.files-changed.outputs.changes == 'true'
name: Backend Seed
needs: files-changed
runs-on: ubuntu-latest
env:
WORKING_DIRECTORY: ./
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.1.7
- name: Build Docker Production
run: |
mkdir -p ./data/uploads
sudo chmod 777 -R ./data
docker compose -f docker-compose.yml up -d
sleep 5
cd backend && ./seed.sh
working-directory: ${{env.WORKING_DIRECTORY}}
#build-development:
# if: needs.files-changed.outputs.changes == 'true'
# name: Build Docker Development
# needs: files-changed
# runs-on: ubuntu-latest
# env:
# WORKING_DIRECTORY: ./
# steps:
# - name: Checkout code
# uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.1.7
#
# - name: Build Docker Development
# run: docker compose build
# working-directory: ${{env.WORKING_DIRECTORY}}

View File

@ -6,12 +6,6 @@ To run the backend you can simply execute
To fill in all required data execute the following commands in order:
```
cd backend
npx directus-sync push \
--directus-url http://localhost:8055 \
--directus-email admin@it4c.dev \
--directus-password admin123
./seed.sh
```
@ -22,6 +16,7 @@ In order to pull data from your locally running backend (see [docker-compose](..
```
npx directus-sync pull \
--dump-path ./directus-config/development \
--directus-url http://localhost:8055 \
--directus-email admin@it4c.dev \
--directus-password admin123
@ -32,6 +27,7 @@ npx directus-sync pull \
To push local changes or to seed directus use the following command
```
npx directus-sync push \
--dump-path ./directus-config/development \
--directus-url http://localhost:8055 \
--directus-email admin@it4c.dev \
--directus-password admin123

View File

@ -58,6 +58,16 @@
"title": "map pin outline",
"tags": [],
"description": "map pin outline"
},
{
"_sync_id": "user-outline",
"_file_path": "./files/icons/outline/user.svg",
"storage": "local",
"folder": "f255d3a7-8ecc-4ee0-b584-dee753317415",
"filename_download": "user-outline.svg",
"title": "user outline",
"tags": [],
"description": "user outline"
}
]
}

View File

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Some files were not shown because too many files have changed in this diff Show More