Skip to content

itk-dev/kunstdatabasen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kunstdatabasen

Production

Upgrade from version 1.5.2

# Upgrade migrations
itkdev-docker-compose bin/console doctrine:migrations:list
itkdev-docker-compose bin/console doctrine:migrations:sync-metadata-storage
itkdev-docker-compose bin/console doctrine:migrations:version --add --all --no-interaction
itkdev-docker-compose bin/console doctrine:migrations:list
itkdev-docker-compose-server pull
itkdev-docker-compose-server up --detach --remove-orphans
itkdev-docker-compose-server exec phpfpm composer install --no-dev --no-scripts
# Upgrade migrations (only once)
itkdev-docker-compose-server exec phpfpm bin/console doctrine:migrations:list
itkdev-docker-compose-server exec phpfpm bin/console doctrine:migrations:sync-metadata-storage
itkdev-docker-compose-server exec phpfpm bin/console doctrine:migrations:version --add --all --no-interaction
# Remove our single new migration
itkdev-docker-compose-server exec phpfpm bin/console doctrine:migrations:version --delete 'DoctrineMigrations\Version20230801120357' --no-interaction
itkdev-docker-compose-server exec phpfpm bin/console doctrine:migrations:list

Install/update

# Edit .env.local
APP_SECRET=…

SUPPORT_MAIL=…
SITEIMPROVE_KEY=…
WEB_ACCESSIBILITY_STATEMENT_URL=…

# Install
itkdev-docker-compose-server pull
itkdev-docker-compose-server up --detach --remove-orphans
itkdev-docker-compose-server exec phpfpm composer install --no-dev
itkdev-docker-compose-server exec phpfpm bin/console doctrine:migrations:migrate --no-interaction

# Build assets using our development setup
docker compose run --rm node yarn install
docker compose run --rm node yarn build
# Clean up
rm -fr node_modules

itkdev-docker-compose-server exec phpfpm bin/console cache:clear --no-interaction

This site comes with an docker setup to do local developement.

Running the docker setup

The default .env file that comes with the project is configured out-of-the-box to match the docker setup.

# Create the frontend network if it does not already exist.
docker network inspect frontend 2>&1 > /dev/null || docker network create frontend
docker compose up --detach

# Install
docker compose exec phpfpm composer install

# Run migrations
docker compose exec phpfpm bin/console doctrine:migrations:migrate --no-interaction

Load fixtures

To ease the development on local setup the project supplies fixtures:

docker compose exec phpfpm bin/console hautelook:fixtures:load --no-bundles

Refresh tags

docker compose exec phpfpm bin/console app:refresh-tags

Open site

open "http://$(docker compose port nginx 8080)"

Open the administration interface:

open "http://$(docker compose port nginx 8080)/admin"

Sign in as admin@example.com with password admin if fixtures have been loaded.

Create an admin user

docker compose exec phpfpm bin/console app:create-user

Browsersync

For testing and to auto-reload browser you can run Browsersync with

browser-sync start --config bs-config.js

Build the frontend

We use Webpack Encore to build frontend assets.

# Install dependencies
docker compose run --rm node yarn install
# Build assets
docker compose run --rm node yarn build

During development you can watch for changes:

docker compose run --rm node yarn watch

Migration in production

Run the migration command:

docker compose exec phpfpm bin/console app:import-spreadsheet var/migration.xls
docker compose exec phpfpm bin/console app:refresh-tags

Add image files in a folder (public/images/migration_images) each named after the inventoryId they match, eg.1000.jpg.

Attach images to Items

docker compose exec phpfpm bin/console app:import-images public/images/migration_images

Build frontend assets:

docker compose run --rm node yarn build

Coding standards

docker compose exec phpfpm composer coding-standards-check
docker compose run --rm node yarn install
docker compose run --rm node yarn coding-standards-check