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
54
.github/workflows/test.backend.seed.yml
vendored
Normal 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}}
|
||||
@ -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
|
||||
|
||||
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
Before Width: | Height: | Size: 473 B After Width: | Height: | Size: 473 B |
|
Before Width: | Height: | Size: 893 B After Width: | Height: | Size: 893 B |
|
Before Width: | Height: | Size: 521 B After Width: | Height: | Size: 521 B |
|
Before Width: | Height: | Size: 558 B After Width: | Height: | Size: 558 B |
|
Before Width: | Height: | Size: 633 B After Width: | Height: | Size: 633 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 853 B After Width: | Height: | Size: 853 B |
|
Before Width: | Height: | Size: 462 B After Width: | Height: | Size: 462 B |
|
Before Width: | Height: | Size: 312 B After Width: | Height: | Size: 312 B |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 517 B After Width: | Height: | Size: 517 B |
|
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
|
Before Width: | Height: | Size: 252 B After Width: | Height: | Size: 252 B |
|
Before Width: | Height: | Size: 873 B After Width: | Height: | Size: 873 B |
|
Before Width: | Height: | Size: 874 B After Width: | Height: | Size: 874 B |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 528 B After Width: | Height: | Size: 528 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 672 B After Width: | Height: | Size: 672 B |
|
Before Width: | Height: | Size: 630 B After Width: | Height: | Size: 630 B |
|
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 513 B After Width: | Height: | Size: 513 B |
|
Before Width: | Height: | Size: 300 B After Width: | Height: | Size: 300 B |
|
Before Width: | Height: | Size: 447 B After Width: | Height: | Size: 447 B |
|
Before Width: | Height: | Size: 789 B After Width: | Height: | Size: 789 B |
|
Before Width: | Height: | Size: 220 B After Width: | Height: | Size: 220 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 544 B After Width: | Height: | Size: 544 B |
|
Before Width: | Height: | Size: 504 B After Width: | Height: | Size: 504 B |
|
Before Width: | Height: | Size: 768 B After Width: | Height: | Size: 768 B |
|
Before Width: | Height: | Size: 509 B After Width: | Height: | Size: 509 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 370 B After Width: | Height: | Size: 370 B |
|
Before Width: | Height: | Size: 339 B After Width: | Height: | Size: 339 B |
|
Before Width: | Height: | Size: 279 B After Width: | Height: | Size: 279 B |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |